summaryrefslogtreecommitdiff
path: root/sys
diff options
context:
space:
mode:
authorReyk Floeter <reyk@cvs.openbsd.org>2017-08-11 13:50:16 +0000
committerReyk Floeter <reyk@cvs.openbsd.org>2017-08-11 13:50:16 +0000
commit983d899b230e96f6db3278040f2bcd04d7a930af (patch)
tree7bcced4c6d2b9cb12fbf07e334594cc12983e16d /sys
parentc70be058b54c8359ceafbf3dda5e8dc63499d3a5 (diff)
Fix out-of-bounds read when looking up the multipart message handler.
This could be triggered by an OpenFlow packet with the multipart message type of 14 ... because C array indexes start at 0. Coverity CID 1452917; Severity: Major OK millert@ goda@
Diffstat (limited to 'sys')
-rw-r--r--sys/net/switchofp.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/sys/net/switchofp.c b/sys/net/switchofp.c
index 1a56b73ed64..e38c9d2e70e 100644
--- a/sys/net/switchofp.c
+++ b/sys/net/switchofp.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: switchofp.c,v 1.63 2017/08/11 13:48:21 reyk Exp $ */
+/* $OpenBSD: switchofp.c,v 1.64 2017/08/11 13:50:15 reyk Exp $ */
/*
* Copyright (c) 2016 Kazuya GODA <goda@openbsd.org>
@@ -1224,7 +1224,7 @@ swofp_lookup_msg_handler(uint8_t type)
ofp_msg_handler
swofp_lookup_mpmsg_handler(uint16_t type)
{
- if (type > nitems(ofp_mpmsg_table))
+ if (type >= nitems(ofp_mpmsg_table))
return (NULL);
else
return (ofp_mpmsg_table[type].mpmsg_handler);