Gustavo Zacarias | e91d3ca | 2014-12-15 17:55:10 -0300 | [diff] [blame] | 1 | From e6aa721cc0e5a48f408c52355559fd36780ba32a Mon Sep 17 00:00:00 2001 |
| 2 | From: =?UTF-8?q?Ingy=20d=C3=B6t=20Net?= <ingy@ingy.net> |
| 3 | Date: Fri, 28 Nov 2014 09:21:49 -0800 |
| 4 | Subject: [PATCH] Fix for https://bitbucket.org/xi/libyaml/issue/10/ |
| 5 | |
| 6 | https://bitbucket.org/xi/libyaml/issue/10/wrapped-strings-cause-assert-failure |
| 7 | |
| 8 | Commenting out the assert makes the scanner do the right thing and |
| 9 | results in just a simple parse failure. |
| 10 | |
| 11 | Signed-off-by: Gustavo Zacarias <gustavo@zacarias.com.ar> |
| 12 | --- |
| 13 | src/scanner.c | 4 +++- |
| 14 | 1 file changed, 3 insertions(+), 1 deletion(-) |
| 15 | |
| 16 | diff --git a/src/scanner.c b/src/scanner.c |
| 17 | index 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 | -- |
| 32 | 2.0.4 |
| 33 | |