Closed Bug 502965 Opened 11 years ago Closed 11 years ago

Allocator mismatch in sdrtest

Categories

(NSS :: Tools, defect, P2)

3.12.3
defect

Tracking

(Not tracked)

RESOLVED FIXED
3.12.4

People

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

Details

Attachments

(3 files)

I have been running all.sh with NSPR and NSS built with different allocators on
Windows - one built with the standard allocator, the other with the debug
allocator.

I found the following problem :

 	msvcr90d.dll!_free_dbg(void * pUserData=0x0285ac70, int nBlockUse=1)  Line 1258 + 0xd bytes	C++
 	msvcr90d.dll!free(void * pUserData=0x0285ac70)  Line 49 + 0xb bytes	C++
>	sdrtest.exe!main(int argc=7, char * * argv=0x020d3410)  Line 439 + 0x10 bytes	C
 	sdrtest.exe!__tmainCRTStartup()  Line 586 + 0x19 bytes	C
 	sdrtest.exe!mainCRTStartup()  Line 403	C
 	kernel32.dll!7d4e7d42()
Attachment #387332 - Flags: review?(nelson)
Priority: -- → P2
Target Milestone: --- → 3.12.5
Attachment #387332 - Flags: review?(nelson) → review+
Comment on attachment 387332 [details] [diff] [review]
Use PR_Free instead of free


>-    if (text.data) free(text.data);
>+    if (text.data) PORT_Free(text.data);

This is correct, although the following would be more exemplary:
      SECITEM_ZfreeItem(&text, PR_FALSE);

Should also document in pk11sdr.h that this is the proper way to free 
the result that is output by PK11SDR_Decrypt.
Nelson,
Thanks for the review. I checked in your version.

Checking in sdrtest.c;
/cvsroot/mozilla/security/nss/cmd/sdrtest/sdrtest.c,v  <--  sdrtest.c
new revision: 1.15; previous revision: 1.14
done
Attachment #387536 - Flags: review?(nelson)
Attachment #387536 - Flags: review?(nelson) → review+
Comment on attachment 387536 [details] [diff] [review]
Add documentation

I think the same is true of PK11SDR_Encrypt, so the comment should probably be added to the block comment for both functions.
Attached patch Add doc v2Splinter Review
Attachment #388550 - Flags: review?(nelson)
Comment on attachment 388550 [details] [diff] [review]
Add doc v2

Merci'
Attachment #388550 - Flags: review?(nelson) → review+
Checking in pk11sdr.h;
/cvsroot/mozilla/security/nss/lib/pk11wrap/pk11sdr.h,v  <--  pk11sdr.h
new revision: 1.4; previous revision: 1.3
done
Status: NEW → RESOLVED
Closed: 11 years ago
Resolution: --- → FIXED
Target Milestone: 3.12.5 → 3.12.4
You need to log in before you can comment on or make changes to this bug.