Out out bounds array access in ibm iconv bits
Commit Message
On Jul 23 2018, Jeff Law <law@redhat.com> wrote:
> So AFAICT this is a true error in the ibm iconv code spotted by Martin's
> improvements to the out of bounds array indexing warning on the gcc trunk.
>
> Building trunk glibc with a trunk gcc (any target AFAICT) on results in
> a warning like this:
>
> In file included from ibm1364.c:393,
> from ibm1390.c:35:
> ../iconv/skeleton.c: In function ‘gconv’:
> ../iconv/loop.c:446:274: error: array subscript 1 is outside array
> bounds of ‘unsigned char[4]’ [-Werror=array-bounds]
> BODY
I think this should fix it:
Andreas.
@@ -296,6 +296,7 @@ enum
/* Next, define the other direction. */
#define MIN_NEEDED_INPUT MIN_NEEDED_TO
+#define MAX_NEEDED_INPUT MAX_NEEDED_TO
#define MIN_NEEDED_OUTPUT MIN_NEEDED_FROM
#define MAX_NEEDED_OUTPUT MAX_NEEDED_FROM
#define LOOPFCT TO_LOOP