Bug 7945 - netconfig dumps core if hostname not found (with source fix!)
netconfig dumps core if hostname not found (with source fix!)
Status: CLOSED RAWHIDE
Product: Red Hat Linux
Classification: Retired
Component: pump (Show other bugs)
6.1
All Linux
medium Severity medium
: ---
: ---
Assigned To: Bill Nottingham
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 1999-12-22 04:50 EST by Stephen J. Friedl
Modified: 2014-03-16 22:11 EDT (History)
2 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2000-02-23 16:04:11 EST
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description Stephen J. Friedl 1999-12-22 04:50:33 EST
pump-0.7.2 contains netconfig (the interactive network setup program),
and when it takes the machine's hostname to do a reverse DNS lookup,
it dumps core if the name is not found.

The problem is in "net.c" near line 464:

    int findHostAndDomain(...)
    {
       ....
    #ifdef __STANDALONE__
       he = gethostbyaddr( (char *)&dev->dev.ip, sizeof....);
       name = he->h_name; /* BUG BUG BUG */
    #else
       name = mygethostbyaddr(inet_ntoa(dev->dev.ip));
    #endif

The bug-marked line dereferences "he" even if it's a NULL, and this
causes a core dump. This line should instead be:

       name = he ? he->h_name : 0;

so that (a) we don't dereference "he" unless it's valid, and
(b) the "name" variable is always initialized with *something*.
Comment 1 Bill Nottingham 1999-12-22 11:51:59 EST
Fixed in CVS. Will be fixed in next pump release.

Note You need to log in before you can comment on or make changes to this bug.