Skip to content

Commit

Permalink
Fix unitialized value crash found by OSS Fuzz
Browse files Browse the repository at this point in the history
Google's OSS Fuzz project found input for libyaml that was capable of
triggering an uninitialized value crash.

Patch provided by Alex Gaynor
  • Loading branch information
sigmavirus24 committed May 13, 2017
1 parent 119b7b6 commit 6bbc217
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
"(\
5 changes: 5 additions & 0 deletions src/scanner.c
Original file line number Diff line number Diff line change
Expand Up @@ -3284,6 +3284,11 @@ yaml_parser_scan_flow_scalar(yaml_parser_t *parser, yaml_token_t *token,

/* Check if we are at the end of the scalar. */

/* Fix for crash unitialized value crash
* Credit for the bug and input is to OSS Fuzz
* Credit for the fix to Alex Gaynor
*/
if (!CACHE(parser, 1)) goto error;
if (CHECK(parser->buffer, single ? '\'' : '"'))
break;

Expand Down

0 comments on commit 6bbc217

Please sign in to comment.