From c4f66413465663529a9aa2559f794d098da7c681 Mon Sep 17 00:00:00 2001 From: Ulrich Drepper Date: Fri, 5 Jan 2001 08:10:28 +0000 Subject: Update. 2001-01-05 Ulrich Drepper * iconv/gconv_simple.c (internal_ics4_loop): Correct test for overflowing output buffer. (internal_ucs4_loop_unaligned): Likewise. (ucs4_internal_loop): Likewise. (ucs4_internal_loop_unaligned): Likewise. (internal_ucs4le_loop): Likewise. (internal_ucs4le_loop_unaligned): Likewise. (ucs4le_internal_loop): Likewise. (ucs4le_internal_loop_unaligned): Likewise. Reported by Owen Taylor . * iconv/Makefile (tests): Add tst-iconv2. * iconv/tst-iconv2.c: New file. --- iconv/gconv_simple.c | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) (limited to 'iconv/gconv_simple.c') diff --git a/iconv/gconv_simple.c b/iconv/gconv_simple.c index ab9f46a..8064bd9 100644 --- a/iconv/gconv_simple.c +++ b/iconv/gconv_simple.c @@ -1,5 +1,5 @@ /* Simple transformations functions. - Copyright (C) 1997, 1998, 1999, 2000 Free Software Foundation, Inc. + Copyright (C) 1997, 1998, 1999, 2000, 2001 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Ulrich Drepper , 1997. @@ -90,7 +90,7 @@ internal_ucs4_loop (struct __gconv_step *step, /* Determine the status. */ if (*inptrp == inend) result = __GCONV_EMPTY_INPUT; - else if (*outptrp == outend) + else if (*outptrp + 4 > outend) result = __GCONV_FULL_OUTPUT; else result = __GCONV_INCOMPLETE_INPUT; @@ -135,7 +135,7 @@ internal_ucs4_loop_unaligned (struct __gconv_step *step, # endif /* Determine the status. */ - if (*outptrp == outend) + if (*outptrp + 4 > outend) result = __GCONV_FULL_OUTPUT; else if (*inptrp == inend) result = __GCONV_EMPTY_INPUT; @@ -260,7 +260,7 @@ ucs4_internal_loop (struct __gconv_step *step, /* Determine the status. */ if (*inptrp == inend) result = __GCONV_EMPTY_INPUT; - else if (*outptrp == outend) + else if (*outptrp + 4 > outend) result = __GCONV_FULL_OUTPUT; else result = __GCONV_INCOMPLETE_INPUT; @@ -328,7 +328,7 @@ ucs4_internal_loop_unaligned (struct __gconv_step *step, /* Determine the status. */ if (*inptrp == inend) result = __GCONV_EMPTY_INPUT; - else if (*outptrp == outend) + else if (*outptrp + 4 > outend) result = __GCONV_FULL_OUTPUT; else result = __GCONV_INCOMPLETE_INPUT; @@ -444,7 +444,7 @@ internal_ucs4le_loop (struct __gconv_step *step, /* Determine the status. */ if (*inptrp == inend) result = __GCONV_EMPTY_INPUT; - else if (*outptrp == outend) + else if (*outptrp + 4 > outend) result = __GCONV_FULL_OUTPUT; else result = __GCONV_INCOMPLETE_INPUT; @@ -489,9 +489,9 @@ internal_ucs4le_loop_unaligned (struct __gconv_step *step, # endif /* Determine the status. */ - if (*inptrp == inend) + if (*inptrp + 4 > inend) result = __GCONV_EMPTY_INPUT; - else if (*outptrp == outend) + else if (*outptrp + 4 > outend) result = __GCONV_FULL_OUTPUT; else result = __GCONV_INCOMPLETE_INPUT; @@ -609,7 +609,7 @@ ucs4le_internal_loop (struct __gconv_step *step, /* Determine the status. */ if (*inptrp == inend) result = __GCONV_EMPTY_INPUT; - else if (*outptrp == outend) + else if (*outptrp + 4 > outend) result = __GCONV_FULL_OUTPUT; else result = __GCONV_INCOMPLETE_INPUT; @@ -678,7 +678,7 @@ ucs4le_internal_loop_unaligned (struct __gconv_step *step, /* Determine the status. */ if (*inptrp == inend) result = __GCONV_EMPTY_INPUT; - else if (*outptrp == outend) + else if (*outptrp + 4 > outend) result = __GCONV_FULL_OUTPUT; else result = __GCONV_INCOMPLETE_INPUT; -- cgit v1.1