mirror of https://github.com/wolfSSL/wolfssl.git
Merge pull request #3702 from guidovranken/zd11603
Prevent dangling pointer in TLSX_Cookie_Usepull/3750/head
commit
f0ce6ada0f
|
@ -6374,6 +6374,9 @@ int TLSX_Cookie_Use(WOLFSSL* ssl, byte* data, word16 len, byte* mac,
|
|||
if (mac != NULL)
|
||||
XMEMCPY(&cookie->data + len, mac, macSz);
|
||||
|
||||
if (extension->data != NULL)
|
||||
XFREE(extension->data, ssl->heap, DYNAMIC_TYPE_TLSX);
|
||||
|
||||
extension->data = (void*)cookie;
|
||||
extension->resp = (byte)resp;
|
||||
|
||||
|
|
Loading…
Reference in New Issue