Red Hat Bugzilla – Bug 7945
netconfig dumps core if hostname not found (with source fix!)
Last modified: 2014-03-16 22:11:49 EDT
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:
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*.
Fixed in CVS. Will be fixed in next pump release.