about summary refs log tree commit diff
path: root/iconv/loop.c
diff options
context:
space:
mode:
authorUlrich Drepper <drepper@gmail.com>2012-01-03 10:37:59 -0500
committerUlrich Drepper <drepper@gmail.com>2012-01-03 10:37:59 -0500
commit5e0d030065a49247b306a2b445fa7720b8ee09cb (patch)
tree3926700987a6215fe458747f4bfec96e7413baca /iconv/loop.c
parentd1863a4e958fb6fcdfdc1a93188c8125ce5476ee (diff)
downloadglibc-5e0d030065a49247b306a2b445fa7720b8ee09cb.tar.gz
glibc-5e0d030065a49247b306a2b445fa7720b8ee09cb.tar.xz
glibc-5e0d030065a49247b306a2b445fa7720b8ee09cb.zip
Fix assertion in gconv's loop.c
Diffstat (limited to 'iconv/loop.c')
-rw-r--r--iconv/loop.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/iconv/loop.c b/iconv/loop.c
index 4f430628f7..2e88b1deef 100644
--- a/iconv/loop.c
+++ b/iconv/loop.c
@@ -1,5 +1,5 @@
 /* Conversion loop frame work.
-   Copyright (C) 1998-2003, 2005, 2008, 2011 Free Software Foundation, Inc.
+   Copyright (C) 1998-2003, 2005, 2008, 2011, 2012 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
    Contributed by Ulrich Drepper <drepper@cygnus.com>, 1998.
 
@@ -390,6 +390,7 @@ SINGLE(LOOPFCT) (struct __gconv_step *step,
   UNPACK_BYTES
 #else
   /* Add the bytes from the state to the input buffer.  */
+  assert ((state->__count & 7) <= sizeof (state->__value));
   for (inlen = 0; inlen < (size_t) (state->__count & 7); ++inlen)
     bytebuf[inlen] = state->__value.__wchb[inlen];
 #endif
@@ -474,7 +475,7 @@ SINGLE(LOOPFCT) (struct __gconv_step *step,
       /* We don't have enough input for another complete input
 	 character.  */
       assert (inend - inptr > (state->__count & ~7));
-      assert (inend - inptr <= 7);
+      assert (inend - inptr <= sizeof (state->__value));
       state->__count = (state->__count & ~7) | (inend - inptr);
       inlen = 0;
       while (inptr < inend)