Skip to content

Commit 6589b58

Browse files
committed
Use emalloc() for hash_hkdf() salt
1 parent 7f9d8dd commit 6589b58

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

ext/hash/hash.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -646,11 +646,11 @@ PHP_FUNCTION(hash_hkdf)
646646
}
647647

648648
if (salt != NULL && salt->len > 0) {
649-
computed_salt = safe_emalloc(salt->len, salt->len, 0);
649+
computed_salt = emalloc(salt->len);
650650
memcpy(computed_salt, salt->val, salt->len);
651651
}
652652
else {
653-
computed_salt = safe_emalloc(ops->digest_size, ops->digest_size, 0);
653+
computed_salt = emalloc(ops->digest_size);
654654
for (i = 0; i < ops->digest_size; i++)
655655
{
656656
computed_salt[i] = 0x00;

0 commit comments

Comments
 (0)