]> git.ipfire.org Git - thirdparty/apache/httpd.git/commitdiff
protect from mismanaged DNS which return blank/null
authorJim Jagielski <jim@apache.org>
Mon, 6 Oct 2008 14:29:12 +0000 (14:29 +0000)
committerJim Jagielski <jim@apache.org>
Mon, 6 Oct 2008 14:29:12 +0000 (14:29 +0000)
hostnames.

git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/branches/1.3.x@702162 13f79535-47bb-0310-9956-ffa450edef68

src/support/logresolve.c

index 5c769a23f67a938059dd938d5587028807e07d41..8671a49d03306379192047ded70a9d80cc63d04d 100644 (file)
@@ -165,7 +165,7 @@ static void cgethost (struct in_addr ipnum, char *string, int check)
 
        hostdata = gethostbyaddr((const char *) &ipnum, sizeof(struct in_addr),
                                 AF_INET);
-       if (hostdata == NULL) {
+       if (hostdata == NULL || !hostdata->h_name || !*hostdata->h_name) {
            if (h_errno > MAX_ERR)
                errors[UNKNOWN_ERR]++;
            else