Skip to content

Commit c373345

Browse files
committed
zend_hash_sort never fails > php 5.5.0. See php/php-src#3936 (comment)
1 parent 865daf7 commit c373345

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

ereg.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -140,7 +140,8 @@ static int _php_regcomp(regex_t *preg, const char *pattern, int cflags)
140140

141141
if (zend_hash_num_elements(&EREG(ht_rc)) >= EREG_CACHE_SIZE) {
142142
/* easier than dealing with overflow as it happens */
143-
if (EREG(lru_counter) >= (1 << 31) || zend_hash_sort(&EREG(ht_rc), (compare_func_t)ereg_lru_cmp, 0) == FAILURE) {
143+
zend_hash_sort(&EREG(ht_rc), (compare_func_t)ereg_lru_cmp, 0);
144+
if (EREG(lru_counter) >= (1 << 31)) {
144145
zend_hash_clean(&EREG(ht_rc));
145146
EREG(lru_counter) = 0;
146147
} else {

0 commit comments

Comments
 (0)