Closed
Bug 276312
Opened 20 years ago
Closed 20 years ago
PK11_DigestOp will crash given a NULL context
Categories
(NSS :: Libraries, defect)
Tracking
(Not tracked)
RESOLVED
DUPLICATE
of bug 276311
People
(Reporter: jason.m.reid, Assigned: wtc)
Details
secStatus = PK11_DigestOp(NULL, buffer, strlen(buffer));
The above code fragment causes a segmentation violation.
> gdb ./hash-tests
GNU gdb 5.3.92
Copyright 2003 Free Software Foundation, Inc.
GDB is free software, covered by the GNU General Public License, and you are
welcome to change it and/or distribute copies of it under certain conditions.
Type "show copying" to see the conditions.
There is absolutely no warranty for GDB. Type "show warranty" for details.
This GDB was configured as "i586-suse-linux"...
(gdb) run
Starting program: /home/jmr/work/nss/tests/Hashing/hash-tests
[New Thread 16384 (LWP 3354)]
deadbeef hash tests with PK11_HashBuf
MD2= 17682ba795d60a2e740ba5f4539007a4
MD5= 4f41243847da693a4f356c0486114bc6
SHA1= f49cf6381e322b147053b74e4500af8533ac1e4c
SHA256= 2baf1f40105d9501fe319a8ec463fdf4325a2a5df445adf3f572f626253678c9
SHA384=
906d9fe92a5e0ad7e020842127f7970b7d2adff3a91106927b592cf157633d86d0be6ab78f5d398e53f705643ccbfb78
SHA512=
113a3bc783d851fc0373214b19ea7be9fa3de541ecb9fe026d52c603e8ea19c174cc0e9705f8b90d312212c0c3a6d8453ddfb3e3141409cf4bedc8ef033590b4
ERROR: PK11_HashBuf succeeded for a NULL digest
PK11_HashBuf failed for an invalide SEC_OID. (expected)
deadbeef hash tests with PK11_CreateDigestContext
MD2= 17682ba795d60a2e740ba5f4539007a4
PK11_CreateDigestContext failed to return a valid context with -1. (expected)
ERROR: PK11_DigestFinal returned success for a digest without PK11_DigestOp ever
being called.
Program received signal SIGSEGV, Segmentation fault.
[Switching to Thread 16384 (LWP 3354)]
0x40043a14 in PK11_DigestOp (context=0x0, in=0xbffff170 "deadbeef", inLen=8)
at pk11cxt.c:777
777 context->init = PR_FALSE;
(gdb) where
#0 0x40043a14 in PK11_DigestOp (context=0x0, in=0xbffff170 "deadbeef",
inLen=8) at pk11cxt.c:777
#1 0x0804909c in main (argc=1, argv=0xbffff1e4) at hash-tests.c:269
Comment 1•20 years ago
|
||
*** This bug has been marked as a duplicate of 276311 ***
Status: NEW → RESOLVED
Closed: 20 years ago
Resolution: --- → DUPLICATE
You need to log in
before you can comment on or make changes to this bug.
Description
•