Closed Bug 189545 Opened 22 years ago Closed 22 years ago

pk11_Finalize may fail if 'count' is larger than 256

Categories

(NSS :: Libraries, defect)

defect
Not set
normal

Tracking

(Not tracked)

RESOLVED DUPLICATE of bug 189345

People

(Reporter: wtc, Assigned: wtc)

Details

Attachments

(1 file, 1 obsolete file)

In lib/pk11wrap/pk11skey.c, function pk11_Finalize, there
is a stack buffer 'char stackBuf[256]' that is passed to
the various C_XxxFinal functions. But we simply fail if
the 'count' returned by the first C_XxxFinal call (with
a NULL buffer) is larger than 256.  We should allocate
a buffer if 'count' is > 256.
Attached patch Proposed patch (obsolete) — Splinter Review
I am relying on the fact that passing a NULL
to PORT_Free is a no-op.  If you don't like
that, I can change it to:
    if (buffer != NULL && buffer != stackBuf) {
	PORT_Free(buffer);
    }
Sorry, the previous patch contains some other
changes that don't pertain to this bug.
Attachment #111881 - Attachment is obsolete: true
I decided to just fix this problem as part of bug 189345.

*** This bug has been marked as a duplicate of 189345 ***
Status: NEW → RESOLVED
Closed: 22 years ago
Resolution: --- → DUPLICATE
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: