summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorderaadt <deraadt@openbsd.org>2009-11-12 16:08:17 +0000
committerderaadt <deraadt@openbsd.org>2009-11-12 16:08:17 +0000
commit06b05e2158542505bc2e3cfe93708d75b3c34d3b (patch)
tree41959c7a245216bd44645f4b5e29859547faad3c
parentfor packets with unknown payloads (outside the range of our knowledge) simply (diff)
downloadwireguard-openbsd-06b05e2158542505bc2e3cfe93708d75b3c34d3b.tar.xz
wireguard-openbsd-06b05e2158542505bc2e3cfe93708d75b3c34d3b.zip
reading off the end of table bug, found by parfait
-rw-r--r--sbin/scsi/libscsi.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/sbin/scsi/libscsi.c b/sbin/scsi/libscsi.c
index b9cde8648d6..9d362cd020c 100644
--- a/sbin/scsi/libscsi.c
+++ b/sbin/scsi/libscsi.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: libscsi.c,v 1.6 2008/01/13 20:23:34 chl Exp $ */
+/* $OpenBSD: libscsi.c,v 1.7 2009/11/12 16:08:17 deraadt Exp $ */
/* Copyright (c) 1994 HD Associates
* (contact: dufault@hda.com)
@@ -197,7 +197,7 @@ do_buff_decode(u_char *databuf, size_t len,
int i = 0;
fmt++; /* Skip '{' */
while (*fmt && (*fmt != '}')) {
- if (i < sizeof(field_name))
+ if (i < sizeof(field_name)-1)
field_name[i++] = *fmt;
fmt++;