From 9fe664635b751a1345c43ecdcfd39a06a1481741 Mon Sep 17 00:00:00 2001 From: deraadt Date: Thu, 2 Jan 2014 00:03:04 +0000 Subject: [PATCH] loadrandom() status should be ignored, so that we do not loop. issue reported by halex --- sys/stand/boot/boot.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/sys/stand/boot/boot.c b/sys/stand/boot/boot.c index 7c8b6ebe810..91ed765eae6 100644 --- a/sys/stand/boot/boot.c +++ b/sys/stand/boot/boot.c @@ -1,4 +1,4 @@ -/* $OpenBSD: boot.c,v 1.38 2013/12/28 02:51:07 deraadt Exp $ */ +/* $OpenBSD: boot.c,v 1.39 2014/01/02 00:03:04 deraadt Exp $ */ /* * Copyright (c) 2003 Dale Rahn @@ -88,16 +88,17 @@ boot(dev_t bootdev) printf("boot> "); } while(!getcmd()); } - st = 0; - bootprompt = 1; /* allow reselect should we fail */ st = loadrandom(BOOTRANDOM, rnddata, sizeof(rnddata)); - if (st != 0) + if (st) printf("loadrandom: error %d\n", st); #ifdef MDRANDOM mdrandom(rnddata, sizeof(rnddata)); #endif + st = 0; + bootprompt = 1; /* allow reselect should we fail */ + printf("booting %s: ", cmd.path); marks[MARK_START] = (u_long)cmd.addr; if ((fd = loadfile(cmd.path, marks, LOAD_ALL)) != -1) { -- 2.20.1