* BLOCK-END # Indentation decrease.
* FLOW-SEQUENCE-START # '['
* FLOW-SEQUENCE-END # ']'
- * BLOCK-SEQUENCE-START # '{'
- * BLOCK-SEQUENCE-END # '}'
+ * FLOW-MAPPING-START # '{'
+ * FLOW-MAPPING-END # '}'
* BLOCK-ENTRY # '-'
* FLOW-ENTRY # ','
* KEY # '?' or nothing (simple keys).
}
/* Fetch the next token from the queue. */
-
+
*token = DEQUEUE(parser, parser->tokens);
parser->token_available = 0;
parser->tokens_parsed ++;
yaml_simple_key_t simple_key;
simple_key.possible = 1;
simple_key.required = required;
- simple_key.token_number =
+ simple_key.token_number =
parser->tokens_parsed + (parser->tokens.tail - parser->tokens.head);
simple_key.mark = parser->mark;
static int
yaml_parser_decrease_flow_level(yaml_parser_t *parser)
{
- yaml_simple_key_t dummy_key; /* Used to eliminate a compiler warning. */
-
if (parser->flow_level) {
parser->flow_level --;
- dummy_key = POP(parser, parser->simple_keys);
+ (void)POP(parser, parser->simple_keys);
}
return 1;
* Push the current indentation level to the stack and set the new level
* the current column is greater than the indentation level. In this case,
* append or insert the specified token into the token queue.
- *
+ *
*/
static int
*
* - in the flow context;
* - in the block context, but not at the beginning of the line or
- * after '-', '?', or ':' (complex value).
+ * after '-', '?', or ':' (complex value).
*/
if (!CACHE(parser, 1)) return 0;
{
/* Set the handle to '' */
- handle = yaml_malloc(1);
+ handle = YAML_MALLOC(1);
if (!handle) goto error;
handle[0] = '\0';
/* Set the handle to '!'. */
yaml_free(handle);
- handle = yaml_malloc(2);
+ handle = YAML_MALLOC(2);
if (!handle) goto error;
handle[0] = '!';
handle[1] = '\0';
*indent = 1;
}
- return 1;
+ return 1;
}
/*
*(string.pointer++) = '/';
break;
- case '\'':
- *(string.pointer++) = '\'';
- break;
-
case '\\':
*(string.pointer++) = '\\';
break;
/* 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;
return 0;
}
-