Fix GH-22167: reject out-of-range SOAP schema integers#22178
Fix GH-22167: reject out-of-range SOAP schema integers#22178LamentXU123 wants to merge 1 commit into
Conversation
| } | ||
|
|
||
| errno = 0; | ||
| lval = ZEND_STRTOL(str, NULL, 10); |
There was a problem hiding this comment.
This is reachable if value contains a ., i.e. is a legitimate floating-point value. But parsing this again with ZEND_STRTOL() will silently discard the fractional part. E.g. test with 3.141.
There was a problem hiding this comment.
We may not want unnecessary bc break, so let's fix it to make it similar to the original behavior in this case (i.e. parse 3.141 returns 3)
|
High level note ; I'd target master rather than 8.4. It's a correct change, but it turns input that currently parses (silently truncated by atoi) into a fatal SOAP-ERROR, so a WSDL |
This is rather like a new feature than a bug fix, we have lots of similar fixes before (i.e. rejecting NUL bytes in some functions) targeting the master branch so this should be targeting it too. |
|
take your time I ll (re)review it saturday at earliest. |
Fixed #22167
I also add logic to deal with numeric-strings. Now, both
2147483648and2147483648abcwill not be accepted (also added tests). Other behaviors remain the same.I don't sure if we can write the helper function in simpler ways using existing Zend API.