mirror of
https://github.com/wolfSSL/wolfssl.git
synced 2025-07-31 11:17:29 +02:00
Merge pull request #3702 from guidovranken/zd11603
Prevent dangling pointer in TLSX_Cookie_Use
This commit is contained in:
@ -6374,6 +6374,9 @@ int TLSX_Cookie_Use(WOLFSSL* ssl, byte* data, word16 len, byte* mac,
|
|||||||
if (mac != NULL)
|
if (mac != NULL)
|
||||||
XMEMCPY(&cookie->data + len, mac, macSz);
|
XMEMCPY(&cookie->data + len, mac, macSz);
|
||||||
|
|
||||||
|
if (extension->data != NULL)
|
||||||
|
XFREE(extension->data, ssl->heap, DYNAMIC_TYPE_TLSX);
|
||||||
|
|
||||||
extension->data = (void*)cookie;
|
extension->data = (void*)cookie;
|
||||||
extension->resp = (byte)resp;
|
extension->resp = (byte)resp;
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user