mirror of
https://sourceware.org/git/glibc.git
synced 2024-11-22 13:00:06 +00:00
Fix 'array subscript is above array bounds' warning in res_send.c
I see this warning in my build on F21 x86_64, which seems to be due to a weak check for array bounds. Fixed by making the bounds check stronger. This is not an actual bug since nscount is never set to anything greater than MAXNS. The compiler however does not know this, so we need the stronger bounds check to quieten the compiler.
This commit is contained in:
parent
8b460906cd
commit
a0d424ef9d
@ -1,3 +1,8 @@
|
||||
2014-12-16 Siddhesh Poyarekar <siddhesh@redhat.com>
|
||||
|
||||
* resolv/res_send.c (__libc_res_nsend): Fix check for nsmap
|
||||
bounds.
|
||||
|
||||
2014-12-16 Arjun Shankar <arjun.is@lostca.se>
|
||||
|
||||
* libio/tst-fopenloc.c: Use test-skeleton.c.
|
||||
|
@ -429,7 +429,7 @@ __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;
|
||||
EXT(statp).nsmap[ns] = n;
|
||||
map[n] = ns++;
|
||||
|
Loading…
Reference in New Issue
Block a user