From: deraadt Date: Thu, 2 Jan 2014 00:03:04 +0000 (+0000) Subject: loadrandom() status should be ignored, so that we do not loop. X-Git-Url: http://artulab.com/gitweb/?a=commitdiff_plain;h=9fe664635b751a1345c43ecdcfd39a06a1481741;p=openbsd loadrandom() status should be ignored, so that we do not loop. issue reported by halex --- 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) {