Defensive coding to prevent a potential segfault.

PR:		14706
Submitted by:	ru
This commit is contained in:
jkh 1999-11-08 16:19:25 +00:00
parent 934bb28b94
commit 8417239202
2 changed files with 2 additions and 2 deletions
release/sysinstall
usr.sbin/sysinstall

@ -478,7 +478,7 @@ tcpMenuSelect(dialogMenuItem *self)
Device *tmp;
tmp = tcpDeviceSelect();
if (tmp && !((DevInfo *)tmp->private)->use_dhcp && !msgYesNo("Would you like to bring the %s interface up right now?", tmp->name))
if (tmp && tmp->private && !((DevInfo *)tmp->private)->use_dhcp && !msgYesNo("Would you like to bring the %s interface up right now?", tmp->name))
if (!tmp->init(tmp))
msgConfirm("Initialization of %s device failed.", tmp->name);
return DITEM_SUCCESS | DITEM_RESTORE;

@ -478,7 +478,7 @@ tcpMenuSelect(dialogMenuItem *self)
Device *tmp;
tmp = tcpDeviceSelect();
if (tmp && !((DevInfo *)tmp->private)->use_dhcp && !msgYesNo("Would you like to bring the %s interface up right now?", tmp->name))
if (tmp && tmp->private && !((DevInfo *)tmp->private)->use_dhcp && !msgYesNo("Would you like to bring the %s interface up right now?", tmp->name))
if (!tmp->init(tmp))
msgConfirm("Initialization of %s device failed.", tmp->name);
return DITEM_SUCCESS | DITEM_RESTORE;