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 a json_decode crash when depth==0
Summary: Setting depth=0 is an error, and should result in NULL, but we weren't checking for it, so in the case of a single, top-level string, we would reading the -1th element of the stack. Differential Revision: D19609959 fbshipit-source-id: 04ca1e0965e04b44df2d5c806a73c3da99ff66fb
- Loading branch information
1 parent
db8bdb9
commit dabd48c
Showing
3 changed files
with
8 additions
and
0 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
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,3 @@ | ||
| <?hh | ||
|
|
||
| var_dump(json_decode('"a"', false, 0, 0)); |
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 @@ | ||
| NULL |