Closed Bug 265708 Opened 20 years ago Closed 20 years ago

count should be CK_ULONG in SECMOD_UpdateSlotList

Categories

(NSS :: Libraries, defect, P1)

3.9.3
Sun
SunOS
defect

Tracking

(Not tracked)

RESOLVED FIXED

People

(Reporter: julien.pierre, Assigned: julien.pierre)

Details

Attachments

(1 file)

The compiler gives the following warnings on most platforms :

"pk11util.c", line 869: warning: argument #3 is incompatible with prototype:
	prototype: pointer to unsigned long : "unknown", line 0
	argument : pointer to int
"pk11util.c", line 892: warning: argument #3 is incompatible with prototype:
	prototype: pointer to unsigned long : "unknown", line 0
	argument : pointer to int

In the LP64 model, this will cause "count" to hold the wrong count from
C_GetSlotList, because CK_ULONG and int are different sizes.
Priority: -- → P1
Target Milestone: --- → 3.9.4
Keywords: sun-orion3
Checked in the patch to NSS_3_9_BRANCH :

Checking in pk11util.c;
/cvsroot/mozilla/security/nss/lib/pk11wrap/pk11util.c,v  <--  pk11util.c
new revision: 1.41.16.3; previous revision: 1.41.16.2
done

and the tip

Checking in pk11util.c;
/cvsroot/mozilla/security/nss/lib/pk11wrap/pk11util.c,v  <--  pk11util.c
new revision: 1.45; previous revision: 1.44
done
Status: NEW → RESOLVED
Closed: 20 years ago
Resolution: --- → FIXED
Comment on attachment 163094 [details] [diff] [review]
change count variable type to CK_ULONG

This fix is needed for the code to be
correct on LP64 platforms, but because
'count' changes from signed to unsigned
and on some platforms from 32-bit to
64-bit, the fix may generate new compiler
warnings (signed/unsigned comparison and
integral type size).
Attachment #163094 - Flags: review+
The function that had the bug, SECMOD_UpdateSlotList,
was a new function added in NSS 3.9.3.  So this bug
was introduced in NSS 3.9.3.
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: