tasn pushed a commit to branch master.

http://git.enlightenment.org/core/efl.git/commit/?id=681328feb54e92e8653f7d4913ed6d6b78e84437

commit 681328feb54e92e8653f7d4913ed6d6b78e84437
Author: Tom Hacohen <t...@stosb.com>
Date:   Sun Oct 4 16:27:52 2015 +0100

    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:

-- 


Reply via email to