[dpdk-dev,6/6] eal_log.c: limit syslog level to RTE_SYSLOG_LEVEL_MAX
Commit Message
Signed-off-by: Matthew Hall <mhall@mhcomputing.net>
---
lib/librte_eal/linuxapp/eal/eal_log.c | 1 +
1 file changed, 1 insertion(+)
@@ -73,6 +73,7 @@ console_log_write(__attribute__((unused)) void *c, const char *buf, size_t size)
/* Syslog error levels are from 0 to 7, so subtract 1 to convert */
loglevel = rte_log_cur_msg_loglevel() - 1;
+ loglevel = loglevel > RTE_SYSLOG_LEVEL_MAX ? RTE_SYSLOG_LEVEL_MAX : loglevel;
memcpy(copybuf, buf, size);
copybuf[size] = '\0';