Skip to content

Commit d91224c

Browse files
committed
Fix GH-13309 and GH-13310: array hashes comparison, wrong buffer len calculation.
php_array_key_compare_string_case_unstable_i has a typo for the second operand resulting in a wrong buffer size calculation. Issue reported by @AlexRudyuk Close GH-13315
1 parent 7d5a966 commit d91224c

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

NEWS

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,10 @@ PHP NEWS
22
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
33
?? ??? ????, PHP 8.2.17
44

5+
- Core:
6+
. Fixed array key as string (case insensitive) comparison typo
7+
for the second operand buffer size. (A. Slepykh)
8+
59
- Curl:
610
. Fix failing tests due to string changes in libcurl 8.6.0. (Ayesh)
711

ext/standard/array.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -188,7 +188,7 @@ static zend_always_inline int php_array_key_compare_string_case_unstable_i(Bucke
188188
l2 = s->key->len;
189189
} else {
190190
s2 = zend_print_long_to_buf(buf2 + sizeof(buf2) - 1, s->h);
191-
l2 = buf2 + sizeof(buf2) - 1 - s1;
191+
l2 = buf2 + sizeof(buf2) - 1 - s2;
192192
}
193193
return zend_binary_strcasecmp_l(s1, l1, s2, l2);
194194
}

0 commit comments

Comments
 (0)