From 681328feb54e92e8653f7d4913ed6d6b78e84437 Mon Sep 17 00:00:00 2001 From: Tom Hacohen Date: Sun, 4 Oct 2015 16:27:52 +0100 Subject: [PATCH] Ecore con: Prevent possible use of uninitialised buffer on the stack. I'm not actually sure if it's a false, because finding the possible options is hard. Just to be safe, it's better to set buf to "" in the else case. I'm doing this instead of initialising the variable so the compiler/static analyser will be able to warn us if there are other code paths that should probably set buf, but don't. CID 1316016 @fix --- src/lib/ecore_con/ecore_con_local.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/lib/ecore_con/ecore_con_local.c b/src/lib/ecore_con/ecore_con_local.c index d3d3ada..c493cc5 100644 --- a/src/lib/ecore_con/ecore_con_local.c +++ b/src/lib/ecore_con/ecore_con_local.c @@ -303,6 +303,10 @@ ecore_con_local_listen( strncpy(buf, svr->name, sizeof(buf) - 1); buf[sizeof(buf) - 1] = 0; } + else + { + buf[0] = '\0'; + } pmode = umask(mask); start: -- 2.7.4