Avoid memcmp() with len=0
This commit is contained in:
parent
fbad6b933b
commit
3cbaea8bc6
@ -3283,7 +3283,7 @@ tv2(void)
|
|||||||
NULL, 0, nonce, key) != 0) {
|
NULL, 0, nonce, key) != 0) {
|
||||||
printf("Decryption of random ciphertext failed");
|
printf("Decryption of random ciphertext failed");
|
||||||
}
|
}
|
||||||
assert(memcmp(message, message2, message_len) == 0);
|
assert(message_len == 0 || memcmp(message, message2, message_len) == 0);
|
||||||
sodium_free(key);
|
sodium_free(key);
|
||||||
sodium_free(nonce);
|
sodium_free(nonce);
|
||||||
sodium_free(ciphertext);
|
sodium_free(ciphertext);
|
||||||
|
Loading…
Reference in New Issue
Block a user