]> andersk Git - libyaml.git/blobdiff - src/scanner.c
Forbid escaped singlequote in doublequotes
[libyaml.git] / src / scanner.c
index 1189d9dbe62b73bcdeddc8963c4be2d280759fc1..068dc1396902a9a1c675cbb499c8ef37ebe6dd0e 100644 (file)
@@ -3166,10 +3166,6 @@ yaml_parser_scan_flow_scalar(yaml_parser_t *parser, yaml_token_t *token,
                         *(string.pointer++) = '/';
                         break;
 
-                    case '\'':
-                        *(string.pointer++) = '\'';
-                        break;
-
                     case '\\':
                         *(string.pointer++) = '\\';
                         break;
@@ -3284,6 +3280,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;
 
This page took 0.234811 seconds and 4 git commands to generate.