summaryrefslogtreecommitdiffstats
path: root/lib/libc/net/getnetbydns.c
diff options
context:
space:
mode:
Diffstat (limited to 'lib/libc/net/getnetbydns.c')
-rw-r--r--lib/libc/net/getnetbydns.c16
1 files changed, 14 insertions, 2 deletions
diff --git a/lib/libc/net/getnetbydns.c b/lib/libc/net/getnetbydns.c
index 369bf2b..fd771f2 100644
--- a/lib/libc/net/getnetbydns.c
+++ b/lib/libc/net/getnetbydns.c
@@ -263,7 +263,13 @@ _dns_getnetbyaddr(void *rval, void *cb_data, va_list ap)
if (anslen < 0) {
#ifdef DEBUG
if (_res.options & RES_DEBUG)
- printf("res_query failed\n");
+ printf("res_search failed\n");
+#endif
+ return NS_UNAVAIL;
+ } else if (anslen > sizeof(buf)) {
+#ifdef DEBUG
+ if (_res.options & RES_DEBUG)
+ printf("res_search static buffer too small");
#endif
return NS_UNAVAIL;
}
@@ -303,7 +309,13 @@ _dns_getnetbyname(void *rval, void *cb_data, va_list ap)
if (anslen < 0) {
#ifdef DEBUG
if (_res.options & RES_DEBUG)
- printf("res_query failed\n");
+ printf("res_search failed\n");
+#endif
+ return NS_UNAVAIL;
+ } else if (anslen > sizeof(buf)) {
+#ifdef DEBUG
+ if (_res.options & RES_DEBUG)
+ printf("res_search static buffer too small");
#endif
return NS_UNAVAIL;
}
OpenPOWER on IntegriCloud