mirror of
https://github.com/php/php-src.git
synced 2026-03-24 00:02:20 +01:00
Avoid potential integer overflow (#18485)
This commit is contained in:
@@ -1053,8 +1053,8 @@ PHP_FUNCTION(grapheme_levenshtein)
|
||||
}
|
||||
|
||||
zend_long *p1, *p2, *tmp;
|
||||
p1 = safe_emalloc(strlen_2 + 1, sizeof(zend_long), 0);
|
||||
p2 = safe_emalloc(strlen_2 + 1, sizeof(zend_long), 0);
|
||||
p1 = safe_emalloc((size_t) strlen_2 + 1, sizeof(zend_long), 0);
|
||||
p2 = safe_emalloc((size_t) strlen_2 + 1, sizeof(zend_long), 0);
|
||||
|
||||
for (i2 = 0; i2 <= strlen_2; i2++) {
|
||||
p1[i2] = i2 * cost_ins;
|
||||
|
||||
Reference in New Issue
Block a user