Last Comment Bug 208996 - Remove an assertion in sec_pkcs7_decoder_start_digests().
: Remove an assertion in sec_pkcs7_decoder_start_digests().
Status: RESOLVED FIXED
[3.7.7][3.4.4]
:
Product: NSS
Classification: Components
Component: Libraries (show other bugs)
: 3.7
: All All
: -- normal (vote)
: 3.8.1
Assigned To: Wan-Teh Chang
: Bishakha Banerjee
Mentors:
Depends on: 174885
Blocks:
  Show dependency treegraph
 
Reported: 2003-06-10 18:44 PDT by Wan-Teh Chang
Modified: 2003-06-20 16:58 PDT (History)
3 users (show)
See Also:
Crash Signature:
(edit)
QA Whiteboard:
Iteration: ---
Points: ---


Attachments
Proposed patch (665 bytes, patch)
2003-06-10 18:48 PDT, Wan-Teh Chang
nelson: review+
Details | Diff | Review

Description Wan-Teh Chang 2003-06-10 18:44:43 PDT
With the recent change to secasn1d.c, an empty "group"
is now decoded into an array containing only the terminating
NULL pointer.  So the following assertion in
sec_pkcs7_decoder_start_digests() is no longer valid and
should be removed.

271     /*
272      * Count the algorithms.
273      */
274     digcnt = 0;
275     while (digestalgs[digcnt] != NULL)
276         digcnt++;
277 
278     /*
279      * No algorithms means no work to do.
280      * This is not expected, so cause an assert.
281      * But if it does happen, just act as if there were
282      * no algorithms specified.
283      */
284     PORT_Assert (digcnt != 0);
285     if (digcnt == 0)
286         return SECSuccess;

Note that the code does the right thing when digcnt is 0.
Comment 1 Wan-Teh Chang 2003-06-10 18:48:29 PDT
Created attachment 125364 [details] [diff] [review]
Proposed patch
Comment 2 Nelson Bolyard (seldom reads bugmail) 2003-06-18 19:46:10 PDT
This bug is related to the fix for 174885
Comment 3 Wan-Teh Chang 2003-06-18 21:18:23 PDT
Patch checked into the tip (3.9), NSS_3_8_BRANCH (3.8.1),
and NSS_3_7_BRANCH (3.7.7).
Comment 4 Wan-Teh Chang 2003-06-20 16:58:20 PDT
Patch checked in on the NSS_3_4_BRANCH (3.4.4).

Note You need to log in before you can comment on or make changes to this bug.