From 54384cf3b09666a9d10902735fcb3ef9cd6b5faf Mon Sep 17 00:00:00 2001 From: Jacques Vidrine Date: Sun, 15 Sep 2002 16:51:09 +0000 Subject: Check for truncation in calls to res_send/res_query/res_search. Fail when it is detected. --- lib/libc/net/hesiod.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'lib/libc/net/hesiod.c') diff --git a/lib/libc/net/hesiod.c b/lib/libc/net/hesiod.c index 701244ac8c22..c22bdbad836b 100644 --- a/lib/libc/net/hesiod.c +++ b/lib/libc/net/hesiod.c @@ -386,8 +386,8 @@ get_txt_records(qclass, name) /* Send the query. */ n = res_send(qbuf, n, abuf, MAX_HESRESP); - if (n < 0) { - errno = ECONNREFUSED; + if (n < 0 || n > MAX_HESRESP) { + errno = ECONNREFUSED; /* XXX */ return NULL; } /* Parse the header of the result. */ -- cgit v1.2.3