pkcs11-spy: fix random crash in print_generic()
Depending on stack state print_generic() could cause crash or spurious garbage in logs. Example crash: *** buffer overflow detected ***: pkcs11test terminated Signed-off-by: Vesa Jääskeläinen <vesa.jaaskelainen@vaisala.com>
This commit is contained in:
parent
1991fa24ae
commit
7007eda0ba
|
@ -141,7 +141,8 @@ print_generic(FILE *f, CK_LONG type, CK_VOID_PTR value, CK_ULONG size, CK_VOID_P
|
||||||
CK_ULONG i;
|
CK_ULONG i;
|
||||||
|
|
||||||
if((CK_LONG)size != -1 && value != NULL) {
|
if((CK_LONG)size != -1 && value != NULL) {
|
||||||
char hex[16*3+1], ascii[16+1];
|
char hex[16*3+1] = {0};
|
||||||
|
char ascii[16+1];
|
||||||
char *hex_ptr = hex, *ascii_ptr = ascii;
|
char *hex_ptr = hex, *ascii_ptr = ascii;
|
||||||
int offset = 0;
|
int offset = 0;
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue