Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 11 Oct 1996 06:41:32 -0700 (PDT)
From:      chou@mpd.tandem.com
To:        freebsd-gnats-submit@freebsd.org
Subject:   bin/1773: A NULL pointer causing segmentation core dumped.
Message-ID:  <199610111341.GAA15852@freefall.freebsd.org>
Resent-Message-ID: <199610111350.GAA16194@freefall.freebsd.org>

next in thread | raw e-mail | index | archive | help

>Number:         1773
>Category:       bin
>Synopsis:       A NULL pointer causing segmentation core dumped.
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    freebsd-bugs
>State:          open
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Fri Oct 11 06:50:01 PDT 1996
>Last-Modified:
>Originator:     Gary Chou
>Organization:
Tandem Computers Inc
>Release:        2.1.5
>Environment:
FreeBSD osipc.isd.tandem.com 2.1.5-RELEASE FreeBSD 2.1.5-RELEASE #0: Wed Jul 17 03:09:31  1996     jkh@whisker.cdrom.com:/usr/src/sys/compile/GENERIC  i386

>Description:
Line 1065 in function default_server_hostnames(), the gethostbyname() will
return NULL if the "ServerName" has incorrect value in the httpd.conf.
Line 1071 will core dumped dur to the NULL pointer of "main". 


>How-To-Repeat:
Give a non-existing domain name of ServerName in httpd.conf.
>Fix:
Add checking against NULL after "gethostbyname()" as following
suggested code:
    if (!main) {
        fprintf(stderr, "httpd:  Host name(%s) lookup failure.\n", def_hostname);
        exit(1);
        }

>Audit-Trail:
>Unformatted:



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199610111341.GAA15852>