summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--lib/libc/net/gethostbydns.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/lib/libc/net/gethostbydns.c b/lib/libc/net/gethostbydns.c
index a77b65d..a5a3e7b 100644
--- a/lib/libc/net/gethostbydns.c
+++ b/lib/libc/net/gethostbydns.c
@@ -664,6 +664,10 @@ _gethostbydnsaddr(addr, len, af)
dprintf("res_query failed (%d)\n", n);
return (NULL);
}
+ if (n > sizeof buf.buf) {
+ dprintf("static buffer is too small (%d)\n", n);
+ return (NULL);
+ }
if (!(hp = gethostanswer(&buf, n, qbuf, T_PTR)))
return (NULL); /* h_errno was set by gethostanswer() */
#ifdef SUNSECURITY
OpenPOWER on IntegriCloud