summaryrefslogtreecommitdiffstats
path: root/usr.sbin/sysinstall/dispatch.c
diff options
context:
space:
mode:
authordd <dd@FreeBSD.org>2001-07-02 00:18:04 +0000
committerdd <dd@FreeBSD.org>2001-07-02 00:18:04 +0000
commit4a798fb83a60241d607536db8b69d9709995a803 (patch)
treeeb3e6d3ae80fce772bbe283df44e815263d1b83f /usr.sbin/sysinstall/dispatch.c
parentb1763d41ddf8b57a46b69e3e8423b9d57392bd6a (diff)
downloadFreeBSD-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/dispatch.c')
-rw-r--r--usr.sbin/sysinstall/dispatch.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/usr.sbin/sysinstall/dispatch.c b/usr.sbin/sysinstall/dispatch.c
index cd64bf0..6373476 100644
--- a/usr.sbin/sysinstall/dispatch.c
+++ b/usr.sbin/sysinstall/dispatch.c
@@ -406,14 +406,14 @@ dispatch_load_floppy(dialogMenuItem *self)
return what;
}
- if (!mediaDevice->init(mediaDevice)) {
+ if (!DEVICE_INIT(mediaDevice)) {
msgConfirm("Unable to mount floppy filesystem.");
what |= DITEM_FAILURE;
mediaClose();
return what;
}
- fp = mediaDevice->get(mediaDevice, cp, TRUE);
+ fp = DEVICE_GET(mediaDevice, cp, TRUE);
if (fp) {
list = dispatch_load_fp(fp);
fclose(fp);
OpenPOWER on IntegriCloud