diff options
author | Mark Kettenis <kettenis@cvs.openbsd.org> | 2021-05-30 19:02:31 +0000 |
---|---|---|
committer | Mark Kettenis <kettenis@cvs.openbsd.org> | 2021-05-30 19:02:31 +0000 |
commit | 0c2fabaccdfd83a62a68bd10daf2de4367a5975a (patch) | |
tree | 6fc09e85a968536188b980dc25d0429355bcfc5c /sbin/disklabel | |
parent | 4e5cc076a685118dbb6dec39bf082a1ae8ef47d4 (diff) |
Fix overlap check in autoalloc code; ending_sector is the sector after the
OpenBSD area of the disk so it is fine if a "foreign" partition starts at
ending_sector.
ok krw@, otto@
Diffstat (limited to 'sbin/disklabel')
-rw-r--r-- | sbin/disklabel/editor.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/sbin/disklabel/editor.c b/sbin/disklabel/editor.c index 86424f85ad5..8708f3d59e4 100644 --- a/sbin/disklabel/editor.c +++ b/sbin/disklabel/editor.c @@ -1,4 +1,4 @@ -/* $OpenBSD: editor.c,v 1.367 2021/03/09 07:03:19 deraadt Exp $ */ +/* $OpenBSD: editor.c,v 1.368 2021/05/30 19:02:30 kettenis Exp $ */ /* * Copyright (c) 1997-2000 Todd C. Miller <millert@openbsd.org> @@ -571,8 +571,8 @@ editor_allocspace(struct disklabel *lp_org) pstart = DL_GETPOFFSET(pp); pend = pstart + psz; if (i != RAW_PART && psz != 0 && - ((pstart >= starting_sector && pstart <= ending_sector) || - (pend > starting_sector && pend < ending_sector))) { + ((pstart >= starting_sector && pstart < ending_sector) || + (pend > starting_sector && pend <= ending_sector))) { overlap = 1; break; } |