summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFlorian Weimer <fweimer@redhat.com>2014-02-03 16:47:42 -0800
committerAaron Patterson <aaron.patterson@gmail.com>2014-02-03 16:57:31 -0800
commitc5d49706c767697a9c2d71194f2c71a6fb1f8877 (patch)
treea2b8c6dcac4da7ac61fe290c721918cb97be11c1
parent012ce850c8090a7cf85e0f00ebbbe9206ce928a0 (diff)
downloadlibyaml-git-c5d49706c767697a9c2d71194f2c71a6fb1f8877.tar.gz
yaml_parser_scan_tag_uri: fix int overflow leading to buffer overflow
-rw-r--r--src/scanner.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/scanner.c b/src/scanner.c
index a2e8619..68fc002 100644
--- a/src/scanner.c
+++ b/src/scanner.c
@@ -2574,7 +2574,7 @@ yaml_parser_scan_tag_uri(yaml_parser_t *parser, int directive,
/* Resize the string to include the head. */
- while (string.end - string.start <= (int)length) {
+ while ((size_t)(string.end - string.start) <= length) {
if (!yaml_string_extend(&string.start, &string.pointer, &string.end)) {
parser->error = YAML_MEMORY_ERROR;
goto error;