Created attachment 370138 [details] [diff] [review] Patch v1 for NSS Trunk (untested) This bug was reported in bug 447882 comment 13 by Rich Megginson <email@example.com> Some code paths in pbe_PK11AlgidToParam call SEC_ASN1DecodeItem without first initializing (zeroing) the structure that will receive the output. This occasionally leads to a crash in sec_asn1d_parse_leaf due to a an uninitialized SECItem structure that has a non-null data pointer, which is not the result of the parser. Rich suggests the attached patch should fix it. I'd like to have steps to reproduce.
Comment on attachment 370138 [details] [diff] [review] Patch v1 for NSS Trunk (untested) r+ looks safe
Note that this doesn't cause a crash, at least none that I saw. valgrind reports it as "Conditional jump or move depends on uninitialised value(s)" at line 1561 (which probably includes 1562 and 1563) in secasn1d.c: http://mxr.mozilla.org/mozilla/source/security/nss/lib/util/secasn1d.c#1561 1560 /* Strip leading zeroes when target is unsigned integer */ 1561 if (state->underlying_kind == SEC_ASN1_INTEGER && /* INTEGER */ 1562 item->len == 0 && /* MSB */ 1563 item->type == siUnsignedInteger) /* unsigned */
Checking in pk11wrap/pk11pbe.c; new revision: 1.23; previous revision: 1.22