summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTheo de Raadt <deraadt@cvs.openbsd.org>2022-03-29 13:57:54 +0000
committerTheo de Raadt <deraadt@cvs.openbsd.org>2022-03-29 13:57:54 +0000
commitf28cdedd0fae81405c7695840065cb0bfc39f32a (patch)
treee7cceeb775b461a1ba6afc587f584853fb3e5b4c
parent6cf92f82961dca77af354874a668b32e0b521427 (diff)
off-by-one check didn't recognize partition 'a' section on specified
disk, and would fall through to the active partition selection from crystal kolipe, ok miod krw
-rw-r--r--sys/arch/amd64/stand/libsa/cmd_i386.c6
-rw-r--r--sys/arch/i386/stand/libsa/cmd_i386.c6
2 files changed, 6 insertions, 6 deletions
diff --git a/sys/arch/amd64/stand/libsa/cmd_i386.c b/sys/arch/amd64/stand/libsa/cmd_i386.c
index 1f928af37f7..3961ee8b671 100644
--- a/sys/arch/amd64/stand/libsa/cmd_i386.c
+++ b/sys/arch/amd64/stand/libsa/cmd_i386.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: cmd_i386.c,v 1.14 2019/05/10 21:20:43 mlarkin Exp $ */
+/* $OpenBSD: cmd_i386.c,v 1.15 2022/03/29 13:57:52 deraadt Exp $ */
/*
* Copyright (c) 1997-1999 Michael Shalayeff
@@ -107,7 +107,7 @@ Xboot(void)
dev += (cmd.argv[1][2] - '0');
part = (cmd.argv[1][3] - 'a');
- if (part > 0)
+ if (part >= 0)
printf("[%x,%d]\n", dev, part);
else
printf("[%x]\n", dev);
@@ -119,7 +119,7 @@ Xboot(void)
goto bad;
/* Frob boot flag in buffer from HD */
- if ((dev & 0x80) && (part > 0)){
+ if ((dev & 0x80) && (part >= 0)) {
int i, j;
for (i = 0, j = DOSPARTOFF; i < 4; i++, j += 16)
diff --git a/sys/arch/i386/stand/libsa/cmd_i386.c b/sys/arch/i386/stand/libsa/cmd_i386.c
index 0a034f820cc..0361cecb5a5 100644
--- a/sys/arch/i386/stand/libsa/cmd_i386.c
+++ b/sys/arch/i386/stand/libsa/cmd_i386.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: cmd_i386.c,v 1.36 2016/06/10 18:36:06 jcs Exp $ */
+/* $OpenBSD: cmd_i386.c,v 1.37 2022/03/29 13:57:53 deraadt Exp $ */
/*
* Copyright (c) 1997-1999 Michael Shalayeff
@@ -119,7 +119,7 @@ Xboot(void)
dev += (cmd.argv[1][2] - '0');
part = (cmd.argv[1][3] - 'a');
- if (part > 0)
+ if (part >= 0)
printf("[%x,%d]\n", dev, part);
else
printf("[%x]\n", dev);
@@ -131,7 +131,7 @@ Xboot(void)
goto bad;
/* Frob boot flag in buffer from HD */
- if ((dev & 0x80) && (part > 0)){
+ if ((dev & 0x80) && (part >= 0)) {
int i, j;
for (i = 0, j = DOSPARTOFF; i < 4; i++, j += 16)