bnicholes 01/03/30 09:37:57
Modified: src/main util.c
Log:
no message
Revision Changes Path
1.197 +9 -7 apache-1.3/src/main/util.c
Index: util.c
===================================================================
RCS file: /home/cvs/apache-1.3/src/main/util.c,v
retrieving revision 1.196
retrieving revision 1.197
diff -u -r1.196 -r1.197
--- util.c 2001/03/14 04:43:04 1.196
+++ util.c 2001/03/30 17:37:54 1.197
@@ -2013,12 +2013,14 @@
int x;
if (!strchr(p->h_name, '.')) {
- for (x = 0; p->h_aliases[x]; ++x) {
- if (strchr(p->h_aliases[x], '.') &&
- (!strncasecmp(p->h_aliases[x], p->h_name, strlen(p->h_name))))
- return ap_pstrdup(a, p->h_aliases[x]);
- }
- return NULL;
+ if (p->h_aliases) {
+ for (x = 0; p->h_aliases[x]; ++x) {
+ if (p->h_aliases[x] && strchr(p->h_aliases[x], '.') &&
+ (!strncasecmp(p->h_aliases[x], p->h_name, strlen(p->h_name))))
+ return ap_pstrdup(a, p->h_aliases[x]);
+ }
+ }
+ return NULL;
}
return ap_pstrdup(a, (void *) p->h_name);
}
@@ -2047,7 +2049,7 @@
if ((!(p = gethostbyname(str)))
|| (!(server_hostname = find_fqdn(a, p)))) {
/* Recovery - return the default servername by IP: */
- if (p && p->h_addr_list[0]) {
+ if (p && p->h_addr_list && p->h_addr_list[0]) {
ap_snprintf(str, sizeof(str), "%pA", p->h_addr_list[0]);
server_hostname = ap_pstrdup(a, str);
/* We will drop through to report the IP-named server */
|