From: kettenis Date: Sun, 30 May 2021 19:02:30 +0000 (+0000) Subject: Fix overlap check in autoalloc code; ending_sector is the sector after the X-Git-Url: http://artulab.com/gitweb/?a=commitdiff_plain;h=ce5a1c4354a3a26c8d1090a99f1a27c59c0077f2;p=openbsd 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@ --- 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 @@ -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; }