Closed
Bug 440062
Opened 15 years ago
Closed 15 years ago
incorrect list element count in PKIX_List_AppendItem function
Categories
(NSS :: Libraries, defect, P2)
Tracking
(Not tracked)
RESOLVED
FIXED
3.12.1
People
(Reporter: alvolkov.bgs, Assigned: alvolkov.bgs)
Details
(Whiteboard: PKIX)
Attachments
(1 file)
1.80 KB,
patch
|
nelson
:
review+
|
Details | Diff | Splinter Review |
PKIX_List structure is the single linked list of PKIX_List object. The head structure keeps count of elements in the list. PKIX_List_AppendItem increments count at the end of function upon success. If PKIX_INCREF(item) returns error, new member(object of PKIX_List structure) will be added to the list, but the count will not be incremented and so the object will be leaked. Here is the code: lastElement = list; for (i = 0; i < length; i++){ lastElement = lastElement->next; } PKIX_CHECK(pkix_List_Create_Internal (PKIX_FALSE, &lastElement->next, plContext), PKIX_LISTCREATEINTERNALFAILED); PKIX_INCREF(item); newElement->item = item; PKIX_CHECK(PKIX_PL_Object_InvalidateCache ((PKIX_PL_Object *)list, plContext), PKIX_OBJECTINVALIDATECACHEFAILED); list->length = list->length + 1;
Assignee | ||
Comment 1•15 years ago
|
||
Attachment #325592 -
Flags: review?(nelson)
Comment 2•15 years ago
|
||
Comment on attachment 325592 [details] [diff] [review] Add new member to the list only upon success. r=nelson
Attachment #325592 -
Flags: review?(nelson) → review+
Assignee | ||
Comment 3•15 years ago
|
||
Patch integrated.
Status: NEW → RESOLVED
Closed: 15 years ago
Resolution: --- → FIXED
Assignee | ||
Updated•15 years ago
|
Priority: -- → P2
Whiteboard: PKIX
Target Milestone: --- → 3.12.1
You need to log in
before you can comment on or make changes to this bug.
Description
•