summaryrefslogtreecommitdiff
path: root/iconv/gconv_simple.c
diff options
context:
space:
mode:
authorUlrich Drepper <drepper@redhat.com>2001-01-05 08:10:28 +0000
committerUlrich Drepper <drepper@redhat.com>2001-01-05 08:10:28 +0000
commitc4f66413465663529a9aa2559f794d098da7c681 (patch)
tree2bef6c1b5e1df73341c818dd2c9677d0ba2d0323 /iconv/gconv_simple.c
parentf8f900ecb9096ec47f5b7bb7626e29223c69061a (diff)
downloadglibc-c4f66413465663529a9aa2559f794d098da7c681.tar.gz
Update.
2001-01-05 Ulrich Drepper <drepper@redhat.com> * 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 <otaylor@redhat.com>. * iconv/Makefile (tests): Add tst-iconv2. * iconv/tst-iconv2.c: New file.
Diffstat (limited to 'iconv/gconv_simple.c')
-rw-r--r--iconv/gconv_simple.c20
1 files changed, 10 insertions, 10 deletions
diff --git a/iconv/gconv_simple.c b/iconv/gconv_simple.c
index ab9f46a9b3..8064bd9f8a 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 <drepper@cygnus.com>, 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;