Closed Bug 528741 Opened 12 years ago Closed 12 years ago
_hash throws a null-argument exception on empty strings
In libpkix, an empty string is represented by a NULL buffer pointer and a 0 buffer length. When libpkix hashes an empty string object, it throws a null-argument exception because of a PKIX_NULLCHECK_TWO macro in pkix_hash that null-checks the 'bytes' buffer pointer even when 'length' is 0. The fix is to null-check the 'bytes' buffer pointer only when 'length' is nonzero.
Attachment #412415 - Flags: review?(alexei.volkov.bugs)
Comment on attachment 412415 [details] [diff] [review] Proposed patch Nelson, could you review this simple patch? Is Alexei out of the office? Thanks.
I checked in the patch on the NSS trunk (NSS 3.12.6). Checking in pkix_tools.c; /cvsroot/mozilla/security/nss/lib/libpkix/pkix/util/pkix_tools.c,v <-- pkix_tools.c new revision: 1.19; previous revision: 1.18 done
Status: ASSIGNED → RESOLVED
Closed: 12 years ago
Resolution: --- → FIXED
Comment on attachment 412415 [details] [diff] [review] Proposed patch thx, Wan-teh, for fixing it.
Attachment #412415 - Flags: review?(alexei.volkov.bugs) → review+
Priority: -- → P1
Version: unspecified → 3.12
You need to log in before you can comment on or make changes to this bug.