mirror of
https://github.com/wolfSSL/wolfssl.git
synced 2025-07-30 02:37:28 +02:00
Fix out of bound memset to 0
In case buf size sz is too small it will get updated to the larger required value and can't be used anymore to clear the buffer. As the buffer is untouched don't need to clear it anyway. Signed-off-by: Nuno Gonçalves <nunojpg@gmail.com>
This commit is contained in:
@ -2030,7 +2030,7 @@ int wolfSSL_session_export_internal(WOLFSSL* ssl, byte* buf, word32* sz,
|
||||
}
|
||||
}
|
||||
|
||||
if (ret != 0 && buf != NULL) {
|
||||
if (ret != 0 && ret != LENGTH_ONLY_E && buf != NULL) {
|
||||
/*in a fail case clear the buffer which could contain partial key info*/
|
||||
XMEMSET(buf, 0, *sz);
|
||||
}
|
||||
|
Reference in New Issue
Block a user