diff options
author | Andreas Schwab <schwab@suse.de> | 1999-07-21 08:19:25 +0000 |
---|---|---|
committer | Andreas Schwab <schwab@suse.de> | 1999-07-21 08:19:25 +0000 |
commit | 43498f02dc0c2aaad9186388e109cc6da16221df (patch) | |
tree | c658e3111a6d9ed63559c6289f54bbf72d95eba3 /nss | |
parent | ce803f0a9104454906d3543a0040d2bcdd903be7 (diff) | |
download | glibc-43498f02dc0c2aaad9186388e109cc6da16221df.tar.gz glibc-43498f02dc0c2aaad9186388e109cc6da16221df.tar.xz glibc-43498f02dc0c2aaad9186388e109cc6da16221df.zip |
(output_hostent): Don't crash if h_aliases is NULL.
Diffstat (limited to 'nss')
-rw-r--r-- | nss/test-netdb.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/nss/test-netdb.c b/nss/test-netdb.c index 358d072a9c..dae4fad942 100644 --- a/nss/test-netdb.c +++ b/nss/test-netdb.c @@ -122,8 +122,9 @@ output_hostent (const char *call, struct hostent *hptr) { printf ("Call: %s returned: name: %s, addr_type: %d\n", call, hptr->h_name, hptr->h_addrtype); - for (pptr = hptr->h_aliases; *pptr != NULL; pptr++) - printf (" alias: %s\n", *pptr); + if (hptr->h_aliases) + for (pptr = hptr->h_aliases; *pptr != NULL; pptr++) + printf (" alias: %s\n", *pptr); for (pptr = hptr->h_addr_list; *pptr != NULL; pptr++) printf (" ip: %s\n", |