Skip to content

Commit eb33623

Browse files
jvoisinLamentXU123
authored andcommitted
Backport: fix integer overflow in mhash_keygen_s2k (#23770)
Backport PR #23770 from master to PHP-8.4. Original commit: 5e02166 Closes #23770
1 parent b03e267 commit eb33623

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

ext/hash/hash.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1328,7 +1328,7 @@ PHP_FUNCTION(mhash_keygen_s2k)
13281328
context = php_hash_alloc_context(ops);
13291329
ops->hash_init(context, NULL);
13301330

1331-
key = ecalloc(1, times * block_size);
1331+
key = ecalloc(times, block_size);
13321332
digest = emalloc(ops->digest_size + 1);
13331333

13341334
for (i = 0; i < times; i++) {

0 commit comments

Comments
 (0)