~ubuntu-branches/ubuntu/karmic/nss/karmic-updates

« back to all changes in this revision

Viewing changes to mozilla/security/nss/lib/libpkix/pkix/util/pkix_list.c

  • Committer: Bazaar Package Importer
  • Author(s): Chris Coulson
  • Date: 2010-03-31 02:23:43 UTC
  • mfrom: (1.1.11 upstream)
  • Revision ID: james.westby@ubuntu.com-20100331022343-ck07ylqk8q474x26
Tags: 3.12.6-0ubuntu0.9.10.1
* New upstream release 3.12.6 RTM (NSS_3_12_6_RTM)
  - fixes CVE-2009-3555 aka US-CERT VU#120541
* Adjust patches to changed upstream code base
  - update debian/patches/38_kbsd.patch
  - update debian/patches/38_mips64_build.patch
  - update debian/patches/85_security_load.patch
* Remove patches that are merged upstream
  - delete debian/patches/91_nonexec_stack.patch
  - update debian/patches/series
* Bump nspr dependency to 4.8
  - update debian/control
* Add new symbols for 3.12.6
  - update debian/libnss3-1d.symbols 
* Enable transitional scheme for SSL renegotiation
  - add 97_SSL_RENEGOTIATE_TRANSITIONAL.patch
  - update debian/patches/series

Show diffs side-by-side

added added

removed removed

Lines of Context:
120
120
 
121
121
        /* We have a valid list. DecRef its item and recurse on next */
122
122
        PKIX_DECREF(list->item);
123
 
        while (nextItem = list->next) {
 
123
        while ((nextItem = list->next) != NULL) {
124
124
            list->next = nextItem->next;
125
125
            nextItem->next = NULL;
126
126
            PKIX_DECREF(nextItem);
1493
1493
                PKIX_ERROR(PKIX_INPUTLISTMUSTBEHEADER);
1494
1494
        }
1495
1495
 
1496
 
        PKIX_CHECK(pkix_List_GetElement(list, index, &element, plContext),
1497
 
                    PKIX_LISTGETELEMENTFAILED);
1498
 
 
1499
1496
        /* Create a new list object */
1500
1497
        PKIX_CHECK(pkix_List_Create_Internal(PKIX_FALSE, &newElem, plContext),
1501
1498
                    PKIX_LISTCREATEINTERNALFAILED);
1502
1499
 
1503
 
        /* Copy the old element's contents into the new element */
1504
 
        newElem->item = element->item;
1505
 
 
1506
 
        /* Set the new element's next pointer to the old element's next */
1507
 
        newElem->next = element->next;
1508
 
 
1509
 
        /* Set the old element's next pointer to the new element */
1510
 
        element->next = newElem;
1511
 
 
1512
 
        PKIX_INCREF(item);
1513
 
        element->item = item;
 
1500
        if (list->length) {
 
1501
            PKIX_CHECK(pkix_List_GetElement(list, index, &element, plContext),
 
1502
                       PKIX_LISTGETELEMENTFAILED);
 
1503
            /* Copy the old element's contents into the new element */
 
1504
            newElem->item = element->item;
 
1505
            /* Add new item to the list */
 
1506
            PKIX_INCREF(item);
 
1507
            element->item = item;
 
1508
            /* Set the new element's next pointer to the old element's next */
 
1509
            newElem->next = element->next;
 
1510
            /* Set the old element's next pointer to the new element */
 
1511
            element->next = newElem;
 
1512
            newElem = NULL;
 
1513
        } else {
 
1514
            PKIX_INCREF(item);
 
1515
            newElem->item = item;
 
1516
            newElem->next = NULL;
 
1517
            list->next = newElem;
 
1518
            newElem = NULL;
 
1519
        }
 
1520
        list->length++;
1514
1521
 
1515
1522
        PKIX_CHECK(PKIX_PL_Object_InvalidateCache
1516
1523
                    ((PKIX_PL_Object *)list, plContext),
1517
1524
                    PKIX_OBJECTINVALIDATECACHEFAILED);
1518
 
 
1519
 
        list->length = list->length + 1;
1520
 
 
1521
1525
cleanup:
1522
 
 
1523
 
        if (PKIX_ERROR_RECEIVED){
1524
 
                PKIX_DECREF(newElem);
1525
 
        }
 
1526
        PKIX_DECREF(newElem);
1526
1527
 
1527
1528
        PKIX_RETURN(LIST);
1528
1529
}