cls: fix array overrun in rtnl_ematch_opnd2txt()

Error found by coverity.

Acked-by: Thomas Graf <tgraf@suug.ch>
Signed-off-by: Thomas Haller <thaller@redhat.com>
This commit is contained in:
Thomas Haller 2014-06-10 15:29:11 +02:00
parent 87682a093a
commit 8532ac5e10

View file

@ -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;
}