2016-04-30 03:08:42 +00:00
|
|
|
Index: glibc-2.23-276-gb65b205/resolv/gethnamaddr.c
|
2015-09-17 16:24:49 +00:00
|
|
|
===================================================================
|
2016-04-30 03:08:42 +00:00
|
|
|
--- glibc-2.23-276-gb65b205.orig/resolv/gethnamaddr.c
|
|
|
|
+++ glibc-2.23-276-gb65b205/resolv/gethnamaddr.c
|
|
|
|
@@ -68,6 +68,7 @@
|
2015-09-17 16:24:49 +00:00
|
|
|
#include <errno.h>
|
2016-04-30 03:08:42 +00:00
|
|
|
#include <stdlib.h>
|
|
|
|
#include <string.h>
|
2015-09-17 16:24:49 +00:00
|
|
|
+#include <libc-internal.h>
|
|
|
|
|
2016-04-30 03:08:42 +00:00
|
|
|
#define MAXALIASES 35
|
|
|
|
#define MAXADDRS 35
|
|
|
|
@@ -864,10 +865,19 @@ addrsort (char **ap, int num)
|
2015-09-17 16:24:49 +00:00
|
|
|
|
|
|
|
p = ap;
|
|
|
|
for (i = 0; i < num; i++, p++) {
|
|
|
|
+ DIAG_PUSH_NEEDS_COMMENT
|
|
|
|
+#if __GNUC_PREREQ (5, 0)
|
|
|
|
+ /* GCC 5.0 warns about array subscript being above array bounds,
|
|
|
|
+ but that's not entirely possible since i is limited to
|
|
|
|
+ _res.nsort which is limited to MAXRESOLVSORT. This
|
|
|
|
+ is likely PR/59124 which is still not fixed. */
|
|
|
|
+ DIAG_IGNORE_NEEDS_COMMENT (5.0, "-Warray-bounds")
|
|
|
|
+#endif
|
|
|
|
for (j = 0 ; (unsigned)j < _res.nsort; j++)
|
|
|
|
if (_res.sort_list[j].addr.s_addr ==
|
|
|
|
(((struct in_addr *)(*p))->s_addr & _res.sort_list[j].mask))
|
|
|
|
break;
|
|
|
|
+ DIAG_POP_NEEDS_COMMENT
|
|
|
|
aval[i] = j;
|
|
|
|
if (needsort == 0 && i > 0 && j < aval[i-1])
|
|
|
|
needsort = i;
|