PHP :: Bug #42090 :: json_decode causes segmentation fault
| Bug #42090 | json_decode causes segmentation fault | ||||
|---|---|---|---|---|---|
| Submitted: | 2007-07-24 20:42 UTC | Modified: | 2007-07-24 23:02 UTC | ||
| From: | iknowatim at yahoo dot com | Assigned: | bjori (profile) | ||
| Status: | Closed | Package: | Reproducible crash | ||
| PHP Version: | 5.2.3 | OS: | Linux (Ubuntu) | ||
| Private report: | No | CVE-ID: | None | ||
[2007-07-24 20:42 UTC] iknowatim at yahoo dot com
Description:
------------
JSON Version 1.2.1
The following program causes PHP to exit with a segmentation fault:
<?php
json_decode("\"");
?>
Instead, it should fail gracefully ("\"" is not valid JSON) and return NULL.
The <a href="http://www.json.org/JSON_checker/">JSON checker</a> correctly reports that it is invalid input:
"syntax error at character 0"
Reproduce code:
---------------
<?php
print_r(json_decode("\""));
?>
Expected result:
----------------
NULL
Actual result:
--------------
Segmentation fault (core dumped)
Patches
Pull Requests
History
AllCommentsChangesGit/SVN commits
[2007-07-24 23:02 UTC] bjori@php.net