Closed Bug 288728 Opened 15 years ago Closed 15 years ago

NSSCMSRecipientID_BrandNew not handled in nss_cms_recipients_traverse

Categories

(NSS :: Libraries, defect, P3)

3.9.5
defect

Tracking

(Not tracked)

RESOLVED FIXED

People

(Reporter: julien.pierre, Assigned: wtc)

References

Details

Attachments

(1 file)

IMO, the following compiler warning warrants its own a bug. I'm not sure what
the correct handling is for this case.

cmsreclist.c: In function `nss_cms_recipients_traverse':
cmsreclist.c:85: warning: enumeration value `NSSCMSRecipientID_BrandNew' not
handled in switch
Priority: -- → P2
Target Milestone: --- → 3.10
QA Contact: bishakhabanerjee → jason.m.reid
Attached patch Proposed patchSplinter Review
I think the fix is to add a "default" case to that
switch statement and handle that as invalid input.

NSSCMSRecipientID_BrandNew is only used as an argument
to nss_cmsrecipientinfo_create, but nss_cmsrecipientinfo_create
doesn't store the NSSCMSRecipientID_BrandNew value anywhere.
Also, the value of NSSCMSRecipientID_BrandNew is 2, so
if any structure field of the type NSSCMSRecipientIDSelector
is initialized to 0 (by a PORT_ZAlloc or PORT_ArenaZAlloc
call) and not assigned a value, its value will be
NSSCMSRecipientID_IssuerSN (0).

While doing the code review, I fixed two assertions in cmsrecinfo.c
to use a whitelist instead of a blacklist.
Attachment #196219 - Flags: review?(julien.pierre.bugs)
Status: NEW → ASSIGNED
Priority: P2 → P3
Target Milestone: 3.10 → 3.11
Attachment #196219 - Flags: review?(julien.pierre.bugs) → review+
Attachment #196219 - Flags: superreview?(rrelyea)
Comment on attachment 196219 [details] [diff] [review]
Proposed patch

sr=relyea
Attachment #196219 - Flags: superreview?(rrelyea) → superreview+
Patch checked in on the NSS trunk for NSS 3.11.
Status: ASSIGNED → RESOLVED
Closed: 15 years ago
Resolution: --- → FIXED
Duplicate of this bug: 229296
You need to log in before you can comment on or make changes to this bug.