DO NOT MERGE: Fix off-by-one error in res_cache.c
(cherry picked from commit 03844d8cdb43c351d2c94eb67242966019f7600d)
Change-Id: Ib5fff46ac9211716a1577ee25bb22461c489ea9f
diff --git a/libc/dns/resolv/res_send.c b/libc/dns/resolv/res_send.c
index 95edada..df8e131 100644
--- a/libc/dns/resolv/res_send.c
+++ b/libc/dns/resolv/res_send.c
@@ -488,10 +488,10 @@
* Send request, RETRY times, or until successful.
*/
for (try = 0; try < statp->retry; try++) {
- struct __res_stats stats[MAXNS];
+ struct __res_stats stats[MAXNS + 1];
struct __res_params params;
int revision_id = _resolv_cache_get_resolver_stats(statp->netid, ¶ms, stats);
- bool usable_servers[MAXNS];
+ bool usable_servers[MAXNS + 1];
_res_stats_get_usable_servers(¶ms, stats, statp->nscount, usable_servers);
for (ns = 0; ns < statp->nscount; ns++) {