From 02e4b3b842a6d79091e1ee5f7d794bb969a4ac46 Mon Sep 17 00:00:00 2001 From: Frank Denis Date: Fri, 25 Mar 2016 09:42:32 +0100 Subject: [PATCH] Check memory base instead of the aligned pointer No behavior change, but it is less confusing to static analyzers --- src/libsodium/crypto_pwhash/argon2/argon2-core.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/libsodium/crypto_pwhash/argon2/argon2-core.c b/src/libsodium/crypto_pwhash/argon2/argon2-core.c index 4ba2ec53..7767827d 100644 --- a/src/libsodium/crypto_pwhash/argon2/argon2-core.c +++ b/src/libsodium/crypto_pwhash/argon2/argon2-core.c @@ -118,7 +118,7 @@ static int allocate_memory(block_region **region, uint32_t m_cost) { memcpy(&memory, &aligned, sizeof memory); } #endif - if (!memory) { + if (base == NULL) { return ARGON2_MEMORY_ALLOCATION_ERROR; } (*region)->base = base;