From: Kirill Simonov Date: Mon, 11 Oct 2010 06:41:03 +0000 (+0000) Subject: Fixed pointer arithmetic overflow when calculating the position of a potential simple... X-Git-Tag: upstream/0.1.4^2~4 X-Git-Url: http://andersk.mit.edu/gitweb/libyaml.git/commitdiff_plain/3b160b6028f8137d32a4d0c6360f7ab1a2226cbf Fixed pointer arithmetic overflow when calculating the position of a potential simple key (#156, thank to ppelletier(at)oblong(dot)com). --- diff --git a/src/scanner.c b/src/scanner.c index 86e2050..a2e8619 100644 --- a/src/scanner.c +++ b/src/scanner.c @@ -1122,7 +1122,7 @@ yaml_parser_save_simple_key(yaml_parser_t *parser) simple_key.possible = 1; simple_key.required = required; simple_key.token_number = - parser->tokens_parsed + parser->tokens.tail - parser->tokens.head; + parser->tokens_parsed + (parser->tokens.tail - parser->tokens.head); simple_key.mark = parser->mark; if (!yaml_parser_remove_simple_key(parser)) return 0;