diff options
-rw-r--r-- | ChangeLog | 3 | ||||
-rw-r--r-- | resolv/res_send.c | 8 |
2 files changed, 10 insertions, 1 deletions
@@ -1,5 +1,8 @@ 2014-12-16 Siddhesh Poyarekar <siddhesh@redhat.com> + * resolv/res_send.c (__libc_res_nsend): Disable warning 'array + subscript above bounds' + * resolv/res_send.c (__libc_res_nsend): Fix check for nsmap bounds. diff --git a/resolv/res_send.c b/resolv/res_send.c index 5a9882c6ad..c35fb66bda 100644 --- a/resolv/res_send.c +++ b/resolv/res_send.c @@ -429,9 +429,15 @@ __libc_res_nsend(res_state statp, const u_char *buf, int buflen, while (ns < MAXNS && EXT(statp).nsmap[ns] != MAXNS) ns++; - if (ns >= MAXNS) + if (ns == MAXNS) break; + /* NS never exceeds MAXNS, but gcc 4.9 somehow + does not see this. */ + DIAG_PUSH_NEEDS_COMMENT; + DIAG_IGNORE_NEEDS_COMMENT (4.9, + "-Warray-bounds"); EXT(statp).nsmap[ns] = n; + DIAG_POP_NEEDS_COMMENT; map[n] = ns++; } EXT(statp).nscount = n; |