-
Notifications
You must be signed in to change notification settings - Fork 7.9k
Fix bug #80565 #6492
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
base: master
Are you sure you want to change the base?
Fix bug #80565 #6492
Conversation
Thanks for the PR! Apparently, the test case is failing; can you please have a look? |
Yes, but I not understood which it's the cause... I looking at che code to spot the problem. |
bugXXX.phpt is failing on AppVeyor as well as on Azure pipelines |
Uh thanks! I try to fix |
Is this a fix for |
|
Mm ok so I think to close PR ? Or not ? |
If you find a good solution, in my opionion, it's fine for "master". :) |
The pipe is passed now. But I found a strange behavior. Soon I push a test... |
btw this test don't pass
The problems it's with the original buffer allocated with the size of the initial input. This function it's written to decrease the size of the buffer I worked a lot to solve. First, I tried with a solution like the first PR (but realloc not work with zend_string or I didn't succeed). |
Ole! Now all green! |
I must resolve conflicts ... |
This Pr point to resolve this bug
https://bugs.php.net/bug.php?id=80565
related for another version:
https://bugs.php.net/bug.php?id=74371
#3570
Originally created for PHP 7.1.3 but still present also in PHP 8/master.
https://3v4l.org/4Yaoj
Like the comment of the original PR, I followed the solution (for security aspects) of encoding the '<' and '>' instead of allowed. Because misuse of this function seems a more pragmatic approach.
The code of PHP 8 it's more readable ma still complex to manage. For this, I chose this approach.
Another solution may refactor the entire function. To allow the internal "state machine" to
know which context it's and change behavior based on this know-how for example.
This solution requires more effort.
To improve the readability I chose to use a macro I don't know if this choice follows the best practices
or the coding standard if not I can convert it to a static function.
For last if this PR it's appreciated, I can try to fix also the previous version like 7.x.
This it's my first PR for this repo so sorry if it does not respect the standard flow.
My apologies but It's been a long time since I wrote code in c. If need I try to improve the quality of code