Skip to content

Commit e8ae192

Browse files
committed
Avoid address calculation overflow
1 parent e4455c3 commit e8ae192

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

ext/standard/string.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2196,7 +2196,7 @@ PHP_FUNCTION(strripos)
21962196
php_error_docref(NULL, E_WARNING, "Offset is greater than the length of haystack string");
21972197
RETURN_FALSE;
21982198
}
2199-
e = ZSTR_VAL(haystack) + ZSTR_LEN(haystack) + (size_t)offset;
2199+
e = ZSTR_VAL(haystack) + (ZSTR_LEN(haystack) + (size_t)offset);
22002200
}
22012201
/* Borrow that ord_needle buffer to avoid repeatedly tolower()ing needle */
22022202
*ZSTR_VAL(ord_needle) = tolower(*ZSTR_VAL(needle));

0 commit comments

Comments
 (0)