Permalink
Show file tree
Hide file tree
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
fix bug #71719 (Buffer overflow in HTTP url parsing functions)
The parser's offset was not reset when we softfail in scheme parsing and continue to parse a path. Thanks to hlt99 at blinkenshell dot org for the report.
- Loading branch information
Showing
4 changed files
with
31 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,3 +1,4 @@ | ||
| package.xml merge=touch | ||
| php_http.h merge=touch | ||
| .travis.yml merge=touch | ||
| /tests/data/bug71719.bin -diff -text |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,25 @@ | ||
| --TEST-- | ||
| Buffer overflow in HTTP url parsing functions | ||
| --SKIPIF-- | ||
| <?php | ||
| include "skipif.inc"; | ||
| ?> | ||
| --FILE-- | ||
| <?php | ||
|
|
||
| echo "Test\n"; | ||
| try { | ||
| echo new http\Message(file_get_contents(__DIR__."/data/bug71719.bin"), false); | ||
| } catch (Exception $e) { | ||
| echo $e; | ||
| } | ||
| ?> | ||
|
|
||
| ===DONE=== | ||
| --EXPECTF-- | ||
| Test | ||
| %r(exception ')?%rhttp\Exception\BadMessageException%r(' with message '|: )%rhttp\Message::__construct(): Could not parse HTTP protocol version 'HTTP/%s.0'%r'?%r in %sbug71719.php:5 | ||
| Stack trace: | ||
| #0 %sbug71719.php(5): http\Message->__construct('\x80\xACTd 5 HTTP/1.1...', false) | ||
| #1 {main} | ||
| ===DONE=== |
Binary file not shown.