Bugzilla will be upgraded to version 5.0 on a still to be determined date in the near future. The original upgrade date has been delayed.
Bug 7945 - netconfig dumps core if hostname not found (with source fix!)
netconfig dumps core if hostname not found (with source fix!)
Product: Red Hat Linux
Classification: Retired
Component: pump (Show other bugs)
All Linux
medium Severity medium
: ---
: ---
Assigned To: Bill Nottingham
Depends On:
  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:
Last Closed: 2000-02-23 16:04:11 EST
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
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 */
       name = mygethostbyaddr(inet_ntoa(dev->dev.ip));

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.