commit aae18d55d80bfcf2c29d7a656ae9ec6ee4722065
parent 907df98e22c1d4cdbf24d100e9c79782ffa14c90
Author: Vincent Forest <vincent.forest@meso-star.com>
Date: Thu, 10 Nov 2016 11:39:54 +0100
Fix the load of an invalid YAML file
If the YAML parser failed to load the document, the parser is invalid
and no more parsing can be performed on the submitted stream.
Diffstat:
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/src/solstice_parser.c b/src/solstice_parser.c
@@ -2161,7 +2161,9 @@ solstice_parser_load(struct solstice_parser* parser)
(unsigned long)parser->parser.problem_mark.line+1,
(unsigned long)parser->parser.problem_mark.column+1,
parser->parser.problem);
- res = RES_IO_ERR;
+ yaml_parser_delete(&parser->parser);
+ parser->parser_is_init = 0;
+ res = RES_BAD_OP;
goto error;
}
doc_is_init = 1;