Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

BAD_COPY_PASTE in ext/standard/array.c #13309

Closed
AlexRudyuk opened this issue Feb 2, 2024 · 1 comment
Closed

BAD_COPY_PASTE in ext/standard/array.c #13309

AlexRudyuk opened this issue Feb 2, 2024 · 1 comment

Comments

@AlexRudyuk
Copy link

Description

ext/standard/array.c

l2 = buf2 + sizeof(buf2) - 1 - s1;

in line 191:
instead of the variable s1, there must be a variable s2, otherwise there is no point in an additional branch of the is() construction.

Found by Linux Verification Center (portal.linuxtesting.ru) with SVACE.
Author A. Slepykh (a.slepykh@fobos-nt.ru).

PHP Version

PHP 8.2.3

Operating System

ALT Linux

@devnexen
Copy link
Member

devnexen commented Feb 2, 2024

Would you mind creating a PR eventually ?

devnexen added a commit to devnexen/php-src that referenced this issue Feb 3, 2024
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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants