Skip to content

Commit

Permalink
Fix for ecc.c kdfsalt possible null pointer
Browse files Browse the repository at this point in the history
  • Loading branch information
aidangarske committed Sep 17, 2024
1 parent 37e96cf commit 9e9a10d
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion wolfcrypt/src/ecc.c
Original file line number Diff line number Diff line change
Expand Up @@ -13895,7 +13895,9 @@ int wc_ecc_ctx_set_kdf_salt(ecEncCtx* ctx, const byte* salt, word32 sz)
ctx->kdfSalt = ctx->serverSalt;
}

XMEMCPY((byte*)ctx->kdfSalt, salt, sz);
if (salt != NULL) {
XMEMCPY((byte*)ctx->kdfSalt, salt, sz);
}
ctx->kdfSaltSz = sz;

return 0;
Expand Down

0 comments on commit 9e9a10d

Please sign in to comment.