about summary refs log tree commit diff
diff options
context:
space:
mode:
-rw-r--r--nscd/nscd_gethst_r.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/nscd/nscd_gethst_r.c b/nscd/nscd_gethst_r.c
index 70ee38b71f..9fa10e2740 100644
--- a/nscd/nscd_gethst_r.c
+++ b/nscd/nscd_gethst_r.c
@@ -328,8 +328,9 @@ nscd_gethst_r (const char *key, size_t keylen, request_type type,
       /* And finally read the aliases.  */
       if (addr_list == NULL)
 	{
-	  if ((size_t) __readall (sock, resultbuf->h_aliases[0], total_len)
-	      == total_len)
+	  if (total_len == 0
+	      || ((size_t) __readall (sock, resultbuf->h_aliases[0], total_len)
+		  == total_len))
 	    {
 	      retval = 0;
 	      *result = resultbuf;