diff options
author | Theo de Raadt <deraadt@cvs.openbsd.org> | 2009-03-28 17:50:06 +0000 |
---|---|---|
committer | Theo de Raadt <deraadt@cvs.openbsd.org> | 2009-03-28 17:50:06 +0000 |
commit | 528569cc2c883733d343c67777d575c2034398c7 (patch) | |
tree | 5a48399c48d2a26cdb7359ebd906bbee17699a20 /sbin/disklabel | |
parent | 05c139d7410386876d9ddff27afd563a0205fa7e (diff) |
do not crash when no mountpoints, spotted by otto; ok krw
Diffstat (limited to 'sbin/disklabel')
-rw-r--r-- | sbin/disklabel/editor.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/sbin/disklabel/editor.c b/sbin/disklabel/editor.c index 4b7fa017bb8..17806e5f016 100644 --- a/sbin/disklabel/editor.c +++ b/sbin/disklabel/editor.c @@ -1,4 +1,4 @@ -/* $OpenBSD: editor.c,v 1.180 2009/03/28 16:27:24 krw Exp $ */ +/* $OpenBSD: editor.c,v 1.181 2009/03/28 17:50:05 deraadt Exp $ */ /* * Copyright (c) 1997-2000 Todd C. Miller <Todd.Miller@courtesan.com> @@ -17,7 +17,7 @@ */ #ifndef lint -static char rcsid[] = "$OpenBSD: editor.c,v 1.180 2009/03/28 16:27:24 krw Exp $"; +static char rcsid[] = "$OpenBSD: editor.c,v 1.181 2009/03/28 17:50:05 deraadt Exp $"; #endif /* not lint */ #include <sys/types.h> @@ -466,7 +466,8 @@ editor(struct disklabel *lp, int f, char *dev, char *fstabfile, int aflag) (mountpoints == NULL || mpequal(mountpoints, omountpoints))) { lastlabel = tmplabel; - mpcopy(omountpoints, tmpmountpoints); + if (mountpoints != NULL) + mpcopy(omountpoints, tmpmountpoints); } } } |