From 8646ea0116df6ef4cdd3c39f94ce53d17724d2cb Mon Sep 17 00:00:00 2001 From: Daniel Mrzyglod Date: Mon, 29 Jun 2015 17:06:03 +0200 Subject: [PATCH] cfgfile: fix unitialised buffer Nature of the problem was not initialised buffer[256], there were probability that operation system will provide previously used memory and on special condition there were probability that string operations will work on random data that could provide unexpected program behaviour. Signed-off-by: Daniel Mrzyglod Acked-by: Cristian Dumitrescu --- lib/librte_cfgfile/rte_cfgfile.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/librte_cfgfile/rte_cfgfile.c b/lib/librte_cfgfile/rte_cfgfile.c index b81c2738c2..a677dadecf 100644 --- a/lib/librte_cfgfile/rte_cfgfile.c +++ b/lib/librte_cfgfile/rte_cfgfile.c @@ -92,7 +92,7 @@ rte_cfgfile_load(const char *filename, int flags) int allocated_entries = 0; int curr_section = -1; int curr_entry = -1; - char buffer[256]; + char buffer[256] = {0}; int lineno = 0; struct rte_cfgfile *cfg = NULL; -- 2.20.1