From c17538277ea7136697b952e1be1ed5b58c2b5629 Mon Sep 17 00:00:00 2001 From: John-Mark Bell Date: Sun, 12 Jan 2014 11:54:46 +0000 Subject: Fix bounds checking. Fixes CID 1152178, 1152179. --- src/charset/codecs/codec_utf16.c | 2 +- src/charset/codecs/codec_utf8.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/charset/codecs/codec_utf16.c b/src/charset/codecs/codec_utf16.c index 19d8bbb..4a2d7ee 100644 --- a/src/charset/codecs/codec_utf16.c +++ b/src/charset/codecs/codec_utf16.c @@ -449,7 +449,7 @@ parserutils_error charset_utf16_codec_read_char(charset_utf16_codec *c, return error; } else if (error == PARSERUTILS_NEEDDATA) { /* Incomplete input sequence */ - if (*sourcelen > INVAL_BUFSIZE) + if (*sourcelen >= INVAL_BUFSIZE) abort(); memmove(c->inval_buf, *source, *sourcelen); diff --git a/src/charset/codecs/codec_utf8.c b/src/charset/codecs/codec_utf8.c index 4de7273..4016ebc 100644 --- a/src/charset/codecs/codec_utf8.c +++ b/src/charset/codecs/codec_utf8.c @@ -441,7 +441,7 @@ parserutils_error charset_utf8_codec_read_char(charset_utf8_codec *c, return error; } else if (error == PARSERUTILS_NEEDDATA) { /* Incomplete input sequence */ - if (*sourcelen > INVAL_BUFSIZE) + if (*sourcelen >= INVAL_BUFSIZE) abort(); memmove(c->inval_buf, *source, *sourcelen); -- cgit v1.2.3