arrfab / rpms / glibc

Forked from rpms/glibc 4 years ago
Clone

Blame SOURCES/glibc-rh1380680-10.patch

147e83
From 8b42b08a1bce2899c0f66ce66ef5fc75745c8f38 Mon Sep 17 00:00:00 2001
147e83
From: Stefan Liebler <stli@linux.vnet.ibm.com>
147e83
Date: Mon, 7 Nov 2016 16:19:30 +0100
147e83
Subject: [PATCH 10/17] S390: Fix build error with gcc6 in utf8_utf16-z9.c.
147e83
147e83
upstream commit 808d70228891ab4d4795ab3dd1e015bf63ba18d6
147e83
147e83
This patch fixes the build error with gcc6:
147e83
array subscript is above array bounds [-Werror=array-bounds]
147e83
147e83
While including loop.c to construct the SINGLE(LOOPFCT) method
147e83
for converting from UTF-16 to UTF-8, the bytebuf array with length
147e83
MAX_NEEDED_INPUT is used as inptr. MAX_NEEDED_INPUT defaults to
147e83
MIN_NEEDED_INPUT if not defined before including loop.c.
147e83
Thus bytebuf has a length of 2.
147e83
This patch defines MAX_NEEDED_INPUT to MAX_NEEDED_TO, which is 4.
147e83
147e83
ChangeLog:
147e83
147e83
	* sysdeps/s390/s390-64/utf8-utf16-z9.c
147e83
	(MAX_NEEDED_INPUT): New define.
147e83
	(MAX_NEEDED_OUTPUT): New define.
147e83
---
147e83
 sysdeps/s390/s390-64/utf8-utf16-z9.c | 2 ++
147e83
 1 file changed, 2 insertions(+)
147e83
147e83
diff --git a/sysdeps/s390/s390-64/utf8-utf16-z9.c b/sysdeps/s390/s390-64/utf8-utf16-z9.c
147e83
index 6dad1c2..590a149 100644
147e83
--- a/sysdeps/s390/s390-64/utf8-utf16-z9.c
147e83
+++ b/sysdeps/s390/s390-64/utf8-utf16-z9.c
147e83
@@ -183,6 +183,7 @@ gconv_end (struct __gconv_step *data)
147e83
 #define MIN_NEEDED_INPUT	MIN_NEEDED_FROM
147e83
 #define MAX_NEEDED_INPUT	MAX_NEEDED_FROM
147e83
 #define MIN_NEEDED_OUTPUT	MIN_NEEDED_TO
147e83
+#define MAX_NEEDED_OUTPUT	MAX_NEEDED_TO
147e83
 #define LOOPFCT			FROM_LOOP
147e83
 /* The software implementation is based on the code in gconv_simple.c.  */
147e83
 #define BODY								\
147e83
@@ -340,6 +341,7 @@ gconv_end (struct __gconv_step *data)
147e83
 /* Conversion from UTF-16 to UTF-8.  */
147e83
 
147e83
 #define MIN_NEEDED_INPUT	MIN_NEEDED_TO
147e83
+#define MAX_NEEDED_INPUT	MAX_NEEDED_TO
147e83
 #define MIN_NEEDED_OUTPUT	MIN_NEEDED_FROM
147e83
 #define MAX_NEEDED_OUTPUT	MAX_NEEDED_FROM
147e83
 #define LOOPFCT			TO_LOOP
147e83
-- 
147e83
1.8.3.1
147e83