public inbox for libc-hacker@sourceware.org
 help / color / mirror / Atom feed
* [PATCH] Fix crash in nscd GETAI call
@ 2010-04-09 15:26 Andreas Schwab
  2010-04-09 20:28 ` Ulrich Drepper
  2010-04-10  4:39 ` Ulrich Drepper
  0 siblings, 2 replies; 3+ messages in thread
From: Andreas Schwab @ 2010-04-09 15:26 UTC (permalink / raw)
  To: libc-hacker

Testcase: getent ahosts irc.freenode.net

Andreas.

2010-04-09  Andreas Schwab  <schwab@redhat.com>

	* nscd/aicache.c (addhstaiX): Don't crash on missing canonical
	name.

---
 nscd/aicache.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/nscd/aicache.c b/nscd/aicache.c
index 992357d..1b3a7ee 100644
--- a/nscd/aicache.c
+++ b/nscd/aicache.c
@@ -166,7 +166,7 @@ addhstaiX (struct database_dyn *db, int fd, request_header *req,
 		addrslen += IN6ADDRSZ;
 	    }
 	  canon = at->name;
-	  canonlen = strlen (canon) + 1;
+	  canonlen = canon == NULL ? 0 : strlen (canon) + 1;
 
 	  total = sizeof (*dataset) + naddrs + addrslen + canonlen;
 
-- 
1.7.0.1


-- 
Andreas Schwab, schwab@redhat.com
GPG Key fingerprint = D4E8 DBE3 3813 BB5D FA84  5EC7 45C6 250E 6F00 984E
"And now for something completely different."

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2010-04-10  4:39 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-04-09 15:26 [PATCH] Fix crash in nscd GETAI call Andreas Schwab
2010-04-09 20:28 ` Ulrich Drepper
2010-04-10  4:39 ` Ulrich Drepper

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).