Add memcmp result checks to avoid gcc optimization

This commit is contained in:
shchmue 2020-05-18 16:51:37 -06:00
parent 4a69ea1922
commit afd17a13ba
4 changed files with 6 additions and 14 deletions

View file

@ -279,7 +279,7 @@ void save_ivfc_storage_read(integrity_verification_storage_ctx_t *ctx, void *buf
hash[0x1F] |= 0x80;
free(data_buffer);
if (memcmp(hash_buffer, hash, 0x20)) {
if (memcmp(hash_buffer, hash, 0x20) != 0) {
ctx->block_validities[block_index] = VALIDITY_INVALID;
} else {
ctx->block_validities[block_index] = VALIDITY_VALID;