Topic: [SOLVED] crash on wc_InitRsaKey_ex()
Hi,
I have faced crash with creating RSA key.
code is very simple like belows.
RsaKey key;
wc_InitRsaKey( &key, NULL );
Crash logs are belows
Process 987165 (temp) terminated SIGSEGV code=2 fltno=11 ip=000000010050f0ab(/usr/lib/libwolfssl.so.12@wc_InitRsaKey_ex+0x000000000000002f) mapaddr=00000000000180ab. ref=0000000008049800
and gdb back trace logs are belows
(gdb) bt
#0 0x000000010050f0ab in wc_InitRsaKey_ex (key=0x80475b0, heap=0x0, devId=-2) at wolfcrypt/src/rsa.c:188
#1 0x000000010050f1c0 in wc_InitRsaKey (key=0x80475b0, heap=0x0) at wolfcrypt/src/rsa.c:223
(gdb) f 0
#0 0x000000010050f0ab in wc_InitRsaKey_ex (key=0x80475b0, heap=0x0, devId=-2) at wolfcrypt/src/rsa.c:188
188 key->type = RSA_TYPE_UNKNOWN;
(gdb) l
183
184 if (key == NULL) {
185 return BAD_FUNC_ARG;
186 }
187
188 key->type = RSA_TYPE_UNKNOWN;
189 key->state = RSA_STATE_NONE;
190 key->heap = heap;
191 key->data = NULL;
192 key->dataLen = 0;
(gdb) print &(key->type)
$12 = (int *) 0x8049800
There is strange because key variable is okay.
Could you help me for fix it?