diff options
author | dd <dd@FreeBSD.org> | 2001-07-02 00:18:04 +0000 |
---|---|---|
committer | dd <dd@FreeBSD.org> | 2001-07-02 00:18:04 +0000 |
commit | 4a798fb83a60241d607536db8b69d9709995a803 (patch) | |
tree | eb3e6d3ae80fce772bbe283df44e815263d1b83f /usr.sbin/sysinstall/tcpip.c | |
parent | b1763d41ddf8b57a46b69e3e8423b9d57392bd6a (diff) | |
download | FreeBSD-src-4a798fb83a60241d607536db8b69d9709995a803.zip FreeBSD-src-4a798fb83a60241d607536db8b69d9709995a803.tar.gz |
Introduce DEVICE_INIT, DEVICE_GET, and DEVICE_SHUTDOWN macros. As the
names suggest, they perform methods on Device's. In addition, they
check that the pointer passed to them is valid; if it isn't, they
pretend that the action failed. This fixes some crashes due to NULL
dereferences (e.g., PR 26509).
Approved by: jkh (some time ago)
Diffstat (limited to 'usr.sbin/sysinstall/tcpip.c')
-rw-r--r-- | usr.sbin/sysinstall/tcpip.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/usr.sbin/sysinstall/tcpip.c b/usr.sbin/sysinstall/tcpip.c index 1be5239..fee6283 100644 --- a/usr.sbin/sysinstall/tcpip.c +++ b/usr.sbin/sysinstall/tcpip.c @@ -644,7 +644,7 @@ tcpMenuSelect(dialogMenuItem *self) variable_unset("NETWORK_CONFIGURED"); save = savescr(); 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)) + if (!DEVICE_INIT(tmp)) msgConfirm("Initialization of %s device failed.", tmp->name); restorescr(save); return DITEM_SUCCESS; |