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/installUpgrade.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/installUpgrade.c')
-rw-r--r-- | usr.sbin/sysinstall/installUpgrade.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/usr.sbin/sysinstall/installUpgrade.c b/usr.sbin/sysinstall/installUpgrade.c index 4b0b4ce..90eaa7c 100644 --- a/usr.sbin/sysinstall/installUpgrade.c +++ b/usr.sbin/sysinstall/installUpgrade.c @@ -308,7 +308,7 @@ media: if (!mediaVerify()) return DITEM_FAILURE; - if (!mediaDevice->init(mediaDevice)) { + if (!DEVICE_INIT(mediaDevice)) { if (!msgYesNo("Couldn't initialize the media. Would you like\n" "to adjust your media selection and try again?")) { mediaDevice = NULL; @@ -442,7 +442,7 @@ installUpgradeNonInteractive(dialogMenuItem *self) systemCreateHoloshell(); } - if (!mediaVerify() || !mediaDevice->init(mediaDevice)) { + if (!mediaVerify() || !DEVICE_INIT(mediaDevice)) { msgNotify("Upgrade: Couldn't initialize media."); return DITEM_FAILURE; } |