Closed Bug 661907 Opened 14 years ago Closed 14 years ago

Double free in NSS_CMSSignerInfo_Sign causes crash when C_Sign is cancelled

Categories

(MailNews Core :: Security: S/MIME, defect)

defect
Not set
normal

Tracking

(Not tracked)

RESOLVED DUPLICATE of bug 621664

People

(Reporter: rfaber, Assigned: rfaber)

References

Details

(Keywords: regression)

Attachments

(1 file)

User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/535.1 (KHTML, like Gecko) Chrome/13.0.782.1 Safari/535.1 Build Identifier: Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US; rv:1.9.2.17) Gecko/20110414 Thunderbird/3.1.10 The method NSS_CMSSignerInfo_Sign() in cmssiginfo.c always calls PORT_FreeArena(tmppoolp, PR_FALSE) immediately after SEC_SignData(). If SEC_SignData() does not return SECSuccess, it then jumps to the error-cleanup where tmppoolp is freed again, causing a crash. A simple fix would be to set tmppoolp to NULL as soon as it has been freed. The problem was introduced when fixing the memoryleak in https://bugzilla.mozilla.org/show_bug.cgi?id=587432 Reproducible: Sometimes Steps to Reproduce: 1. Install a PKCS#11 library that can cancel C_Sign or otherwise fail to complete the call. 2. Attempt to digitally sign a message using Thunderbird or cmsutil. 3. Cause the PKCS#11 module to return something else than CKR_OK (f.x. CKR_FUNCTION_CANCELLED). Actual Results: Segmentation fault Expected Results: An error-message explaining that the operation was aborted.
Assignee: nobody → rfaber
Status: UNCONFIRMED → ASSIGNED
Ever confirmed: true
Attachment #537378 - Flags: review?(wtc)
Blocks: 587432
Keywords: regression
Apparently a duplicate of bug 621664.
Status: ASSIGNED → RESOLVED
Closed: 14 years ago
Resolution: --- → DUPLICATE
Product: Core → MailNews Core
Comment on attachment 537378 [details] [diff] [review] Avoid double free by setting tmppoolp to NULL after the first free. Removing obsolete review request for patch that was landed in a bug this was marked as duplicate of.
Attachment #537378 - Flags: review?(wtc)
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: