summaryrefslogtreecommitdiff
path: root/sbin
diff options
context:
space:
mode:
authorKenneth R Westerback <krw@cvs.openbsd.org>2008-01-08 13:12:27 +0000
committerKenneth R Westerback <krw@cvs.openbsd.org>2008-01-08 13:12:27 +0000
commit6ec508422037069f69bb75d80acf5d48f6a163bb (patch)
treee6f4d0da2f7b8c7c25c84aa563c5f3cdf0b114a8 /sbin
parent8f7438b6196e800b9957144a068e4c5ab486bc5b (diff)
Ensure that the initial free space chunk can't have a length <= 0.
Diffstat (limited to 'sbin')
-rw-r--r--sbin/disklabel/editor.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/sbin/disklabel/editor.c b/sbin/disklabel/editor.c
index f75c6fd9d6b..ff93512fee8 100644
--- a/sbin/disklabel/editor.c
+++ b/sbin/disklabel/editor.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: editor.c,v 1.147 2008/01/08 13:07:10 krw Exp $ */
+/* $OpenBSD: editor.c,v 1.148 2008/01/08 13:12:26 krw 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.147 2008/01/08 13:07:10 krw Exp $";
+static char rcsid[] = "$OpenBSD: editor.c,v 1.148 2008/01/08 13:12:26 krw Exp $";
#endif /* not lint */
#include <sys/types.h>
@@ -1373,7 +1373,7 @@ free_chunks(struct disklabel *lp)
/* Find chunks of free space */
numchunks = 0;
- if (spp && DL_GETPOFFSET(spp[0]) > 0) {
+ if (spp && DL_GETPOFFSET(spp[0]) > starting_sector) {
chunks[0].start = starting_sector;
chunks[0].stop = DL_GETPOFFSET(spp[0]);
numchunks++;