mirror of
https://github.com/wolfSSL/wolfssl.git
synced 2025-07-29 18:27:29 +02:00
Catch allocation failure in ASNToHexString
This commit is contained in:
@ -16166,6 +16166,10 @@ static int ASNToHexString(const byte* input, word32* inOutIdx, char** out,
|
||||
}
|
||||
|
||||
str = (char*)XMALLOC(len * 2 + 1, heap, heapType);
|
||||
if (str == NULL) {
|
||||
return MEMORY_E;
|
||||
}
|
||||
|
||||
for (i=0; i<len; i++)
|
||||
ByteToHex(input[*inOutIdx + i], str + i*2);
|
||||
str[len*2] = '\0';
|
||||
|
Reference in New Issue
Block a user