[PATCH 5/9] cls: fix array overrun in rtnl_ematch_opnd2txt()

Thomas Haller thaller at redhat.com
Tue Jun 10 09:59:41 PDT 2014


Error found by coverity.

Signed-off-by: Thomas Haller <thaller at redhat.com>
---
 lib/route/cls/ematch.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/lib/route/cls/ematch.c b/lib/route/cls/ematch.c
index ab30324..6cbe274 100644
--- a/lib/route/cls/ematch.c
+++ b/lib/route/cls/ematch.c
@@ -692,7 +692,7 @@ static const char *operand_txt[] = {
 char *rtnl_ematch_opnd2txt(uint8_t opnd, char *buf, size_t len)
 {
 	snprintf(buf, len, "%s",
-		opnd <= ARRAY_SIZE(operand_txt) ? operand_txt[opnd] : "?");
+		opnd < ARRAY_SIZE(operand_txt) ? operand_txt[opnd] : "?");
 
 	return buf;
 }
-- 
1.9.3




More information about the libnl mailing list