diff options
author | pst <pst@FreeBSD.org> | 1997-05-10 17:11:24 +0000 |
---|---|---|
committer | pst <pst@FreeBSD.org> | 1997-05-10 17:11:24 +0000 |
commit | 5681e6fd51e2d8b6bac63e3c6e700141ca75b7bb (patch) | |
tree | 48b705491e3d3023333b11b8cf13927dbdb82ada /usr.sbin | |
parent | 824696dc98c3a0d29af46d3b3ef2a83c1195aea9 (diff) | |
download | FreeBSD-src-5681e6fd51e2d8b6bac63e3c6e700141ca75b7bb.zip FreeBSD-src-5681e6fd51e2d8b6bac63e3c6e700141ca75b7bb.tar.gz |
Fix null dereference if config variable not set.
Diffstat (limited to 'usr.sbin')
-rw-r--r-- | usr.sbin/sade/disks.c | 6 | ||||
-rw-r--r-- | usr.sbin/sysinstall/disks.c | 6 |
2 files changed, 6 insertions, 6 deletions
diff --git a/usr.sbin/sade/disks.c b/usr.sbin/sade/disks.c index b2d78ed..34a0c1d 100644 --- a/usr.sbin/sade/disks.c +++ b/usr.sbin/sade/disks.c @@ -4,7 +4,7 @@ * This is probably the last program in the `sysinstall' line - the next * generation being essentially a complete rewrite. * - * $Id: disks.c,v 1.83 1997/04/20 16:46:27 jkh Exp $ + * $Id: disks.c,v 1.84 1997/05/05 05:16:00 pst Exp $ * * Copyright (c) 1995 * Jordan Hubbard. All rights reserved. @@ -248,13 +248,13 @@ diskPartition(Device *dev, Disk *d) case 'A': cp = variable_get(VAR_DEDICATE_DISK); - if (!strcasecmp(cp, "always")) + if (cp && !strcasecmp(cp, "always")) rv = 1; else { rv = msgYesNo("Do you want to do this with a true partition entry\n" "so as to remain cooperative with any future possible\n" "operating systems on the drive(s)?"); - if (rv != 0 && strcasecmp(cp, "nowarn")) { + if (rv != 0 && (!cp || strcasecmp(cp, "nowarn"))) { rv = !msgYesNo("This is dangerous in that it will make the drive totally\n" "uncooperative with other potential operating systems on the\n" "same disk. It will lead instead to a totally dedicated disk,\n" diff --git a/usr.sbin/sysinstall/disks.c b/usr.sbin/sysinstall/disks.c index b2d78ed..34a0c1d 100644 --- a/usr.sbin/sysinstall/disks.c +++ b/usr.sbin/sysinstall/disks.c @@ -4,7 +4,7 @@ * This is probably the last program in the `sysinstall' line - the next * generation being essentially a complete rewrite. * - * $Id: disks.c,v 1.83 1997/04/20 16:46:27 jkh Exp $ + * $Id: disks.c,v 1.84 1997/05/05 05:16:00 pst Exp $ * * Copyright (c) 1995 * Jordan Hubbard. All rights reserved. @@ -248,13 +248,13 @@ diskPartition(Device *dev, Disk *d) case 'A': cp = variable_get(VAR_DEDICATE_DISK); - if (!strcasecmp(cp, "always")) + if (cp && !strcasecmp(cp, "always")) rv = 1; else { rv = msgYesNo("Do you want to do this with a true partition entry\n" "so as to remain cooperative with any future possible\n" "operating systems on the drive(s)?"); - if (rv != 0 && strcasecmp(cp, "nowarn")) { + if (rv != 0 && (!cp || strcasecmp(cp, "nowarn"))) { rv = !msgYesNo("This is dangerous in that it will make the drive totally\n" "uncooperative with other potential operating systems on the\n" "same disk. It will lead instead to a totally dedicated disk,\n" |