blob: a267e4084ca322869371ee4bf5df9d8c299f973c [file] [log] [blame]
Gustavo Zacariase91d3ca2014-12-15 17:55:10 -03001From e6aa721cc0e5a48f408c52355559fd36780ba32a Mon Sep 17 00:00:00 2001
2From: =?UTF-8?q?Ingy=20d=C3=B6t=20Net?= <ingy@ingy.net>
3Date: Fri, 28 Nov 2014 09:21:49 -0800
4Subject: [PATCH] Fix for https://bitbucket.org/xi/libyaml/issue/10/
5
6https://bitbucket.org/xi/libyaml/issue/10/wrapped-strings-cause-assert-failure
7
8Commenting out the assert makes the scanner do the right thing and
9results in just a simple parse failure.
10
11Signed-off-by: Gustavo Zacarias <gustavo@zacarias.com.ar>
12---
13 src/scanner.c | 4 +++-
14 1 file changed, 3 insertions(+), 1 deletion(-)
15
16diff --git a/src/scanner.c b/src/scanner.c
17index 88d4fa5..c5f3d2f 100644
18--- a/src/scanner.c
19+++ b/src/scanner.c
20@@ -1110,7 +1110,9 @@ yaml_parser_save_simple_key(yaml_parser_t *parser)
21 * line. Therefore it is always allowed. But we add a check anyway.
22 */
23
24- assert(parser->simple_key_allowed || !required); /* Impossible. */
25+ /* XXX This caused:
26+ * https://bitbucket.org/xi/libyaml/issue/10/wrapped-strings-cause-assert-failure
27+ assert(parser->simple_key_allowed || !required); */ /* Impossible. */
28
29 /*
30 * If the current position may start a simple key, save it.
31--
322.0.4
33