From: Benoît Ganne Date: Thu, 26 Nov 2020 18:56:44 +0000 (+0100) Subject: vlib: fix vlib log elog vector overrun X-Git-Tag: v21.06-rc0~101 X-Git-Url: https://gerrit.fd.io/r/gitweb?a=commitdiff_plain;h=633122e1fd06a3f09e3cd08732fc49b5d0028221;p=vpp.git vlib: fix vlib log elog vector overrun vlib log strings are vectors not necessarily null-terminated C-string. Type: fix Fixes: bc867c3d2137dab4b1395196c1936233517980ab Change-Id: Ia805ecdf4e76ccb1001dc93647161ee1c3adebc9 Signed-off-by: Benoît Ganne --- diff --git a/src/vlib/log.c b/src/vlib/log.c index bd456aeafe9..ed14d9ecdc6 100644 --- a/src/vlib/log.c +++ b/src/vlib/log.c @@ -251,7 +251,7 @@ vlib_log (vlib_log_level_t level, vlib_log_class_t class, char *fmt, ...) /* *INDENT-ON* */ ed = ELOG_DATA (&vm->elog_main, ee); ed->log_level = level; - ed->string_index = elog_string (&vm->elog_main, (char *) e->string); + ed->string_index = elog_string (&vm->elog_main, "%v", e->string); } lm->next = (lm->next + 1) % lm->size;