log: Validate the size of vec in vlib_log

Change-Id: I6d1218c17ee055275596b9a49767f15994aa1b2b
Signed-off-by: Mohsin Kazmi <sykazmi@cisco.com>
This commit is contained in:
Mohsin Kazmi
2018-05-18 16:27:26 +02:00
committed by Damjan Marion
parent 398fdc1a87
commit 2f63bc9482

View File

@ -142,6 +142,7 @@ vlib_log (vlib_log_level_t level, vlib_log_class_t class, char *fmt, ...)
u8 *s = 0;
bool use_formatted_log_entry = true;
vec_validate (lm->entries, lm->size);
/* make sure we are running on the main thread to avoid use in dataplane
code, for dataplane logging consider use of event-logger */
ASSERT (vlib_get_thread_index () == 0);