summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorxi <xi@18f92427-320e-0410-9341-c67f048884a3>2010-10-11 06:41:03 +0000
committerxi <xi@18f92427-320e-0410-9341-c67f048884a3>2010-10-11 06:41:03 +0000
commit350b12c40b15139c5d09b4200a12ff4093c4f0c7 (patch)
treec20625e9a670c91bc7ac8edae7eafa5c63972f96
parent4947335540988a5d6b82bb144770b43b60cab309 (diff)
downloadlibyaml-350b12c40b15139c5d09b4200a12ff4093c4f0c7.tar.gz
Fixed pointer arithmetic overflow when calculating the position of a potential simple key (#156, thank to ppelletier(at)oblong(dot)com).
git-svn-id: http://svn.pyyaml.org/libyaml/branches/stable@371 18f92427-320e-0410-9341-c67f048884a3
-rw-r--r--src/scanner.c2
1 files changed, 1 insertions, 1 deletions
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;