summaryrefslogtreecommitdiff
path: root/sys/stand/boot
diff options
context:
space:
mode:
authorTobias Stoeckmann <tobias@cvs.openbsd.org>2014-06-27 20:35:38 +0000
committerTobias Stoeckmann <tobias@cvs.openbsd.org>2014-06-27 20:35:38 +0000
commit0422f28a8b7439ef2b297b4705ca761cfb15b5f3 (patch)
treef6fe8a57201b635c3c9cfedea02fe0601d48b439 /sys/stand/boot
parenta042f02758de3bf3c2c169797f936cdc62d8806a (diff)
Avoid buffer overflow on max line length by ending string with just one \0.
ok deraadt@
Diffstat (limited to 'sys/stand/boot')
-rw-r--r--sys/stand/boot/cmd.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/sys/stand/boot/cmd.c b/sys/stand/boot/cmd.c
index ccc2e571f6e..204254f3bec 100644
--- a/sys/stand/boot/cmd.c
+++ b/sys/stand/boot/cmd.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: cmd.c,v 1.61 2013/12/23 23:32:40 deraadt Exp $ */
+/* $OpenBSD: cmd.c,v 1.62 2014/06/27 20:35:37 tobias Exp $ */
/*
* Copyright (c) 1997-1999 Michael Shalayeff
@@ -283,7 +283,7 @@ readline(char *buf, size_t n, int to)
continue;
case '\n':
case '\r':
- p[1] = *p = '\0';
+ *p = '\0';
break;
case '\b':
case '\177':