Skip to content

Commit

Permalink
kdf_scrypt_reset(): NULLify freed pointers
Browse files Browse the repository at this point in the history
Otherwise doublefree happens with further usage.
  • Loading branch information
t8m committed Jan 20, 2025
1 parent 76a63ba commit f428efe
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions providers/implementations/kdfs/scrypt.c
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,9 @@ static void kdf_scrypt_reset(void *vctx)
KDF_SCRYPT *ctx = (KDF_SCRYPT *)vctx;

OPENSSL_free(ctx->salt);
ctx->salt = NULL;
OPENSSL_clear_free(ctx->pass, ctx->pass_len);
ctx->pass = NULL;
kdf_scrypt_init(ctx);
}

Expand Down

0 comments on commit f428efe

Please sign in to comment.