From bb84d3b33c5d8b5a13606006ecd7d0e45a8ecf90 Mon Sep 17 00:00:00 2001 From: Ulrich Drepper Date: Fri, 24 Aug 2001 20:38:43 +0000 Subject: Update. * nss/test-netdb.c (test_hosts): Don't segfault if gethostname returns NULL. --- ChangeLog | 3 +++ nss/test-netdb.c | 9 ++++++--- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/ChangeLog b/ChangeLog index b34092e..46bce19 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,8 @@ 2001-08-24 Ulrich Drepper + * nss/test-netdb.c (test_hosts): Don't segfault if gethostname + returns NULL. + * elf/do-rel.h (elf_dynamic_do_rel): Fix problem with ld.so startup. Explicitly remove lazy part for RTLD_BOOTSTRAP since gcc doesn't do it. diff --git a/nss/test-netdb.c b/nss/test-netdb.c index 8ae6d12..a701b49 100644 --- a/nss/test-netdb.c +++ b/nss/test-netdb.c @@ -185,12 +185,15 @@ test_hosts (void) if (gethostname (name, namelen) == 0) { printf ("Hostname: %s\n", name); - hptr1 = gethostbyname (name); - output_hostent ("gethostbyname (gethostname(...))", hptr1); + if (name != NULL) + { + hptr1 = gethostbyname (name); + output_hostent ("gethostbyname (gethostname(...))", hptr1); + } } ip.s_addr = htonl (INADDR_LOOPBACK); - hptr1 = gethostbyaddr ((char *)&ip, sizeof(ip), AF_INET); + hptr1 = gethostbyaddr ((char *) &ip, sizeof(ip), AF_INET); if (hptr1 != NULL) { printf ("official name of 127.0.0.1: %s\n", hptr1->h_name); -- cgit v1.1