diff --git a/src/libsodium/crypto_onetimeauth/poly1305/onetimeauth_poly1305_try.c b/src/libsodium/crypto_onetimeauth/poly1305/onetimeauth_poly1305_try.c index 42df4167..3137b7ad 100644 --- a/src/libsodium/crypto_onetimeauth/poly1305/onetimeauth_poly1305_try.c +++ b/src/libsodium/crypto_onetimeauth/poly1305/onetimeauth_poly1305_try.c @@ -34,7 +34,7 @@ allocate(void) k2 = _sodium_alignedcalloc(&k2_, crypto_onetimeauth_KEYBYTES + crypto_onetimeauth_BYTES); - return !(h && m && k && h2 && m2 && k2); + return -!(h && m && k && h2 && m2 && k2); } static void @@ -143,7 +143,9 @@ crypto_onetimeauth_pick_best_implementation(void) (implementations[i]) != 0) { continue; } - allocate(); + if (allocate() != 0) { + return NULL; + } err = checksum_compute(); deallocate(); if (err == NULL && strcmp(checksum, CHECKSUM) == 0) {