mirror of
https://github.com/wolfSSL/wolfssl.git
synced 2026-01-26 14:32:20 +01:00
Do not allow NULL with non-zero length.
This commit is contained in:
@@ -313,7 +313,8 @@ int wc_XChaCha20Poly1305_Init(
|
||||
byte authKey[CHACHA20_POLY1305_AEAD_KEYSIZE];
|
||||
int ret;
|
||||
|
||||
if ((aead == NULL) || (nonce == NULL) || (key == NULL))
|
||||
if ((aead == NULL) || (ad == NULL && ad_len > 0) || (nonce == NULL) ||
|
||||
(key == NULL))
|
||||
return BAD_FUNC_ARG;
|
||||
|
||||
if ((key_len != CHACHA20_POLY1305_AEAD_KEYSIZE) ||
|
||||
|
||||
Reference in New Issue
Block a user