raster pushed a commit to branch master.

http://git.enlightenment.org/core/efl.git/commit/?id=38735806c69f24779df7eac1338508476f0324c8

commit 38735806c69f24779df7eac1338508476f0324c8
Author: Carsten Haitzler (Rasterman) <[email protected]>
Date:   Fri Jul 8 11:45:07 2016 +0900

    emotion libvlc module - fix possible argv init issue with tokens
    
    fixes CID 1357170
---
 src/modules/emotion/libvlc/emotion_libvlc.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/modules/emotion/libvlc/emotion_libvlc.c 
b/src/modules/emotion/libvlc/emotion_libvlc.c
index c550551..3c73451 100644
--- a/src/modules/emotion/libvlc/emotion_libvlc.c
+++ b/src/modules/emotion/libvlc/emotion_libvlc.c
@@ -1449,7 +1449,7 @@ libvlc_new_env_args(void)
      goto fallback;
 
    /* alloc argv */
-   argv = malloc(argc * sizeof(char *));
+   argv = calloc(1, argc * sizeof(char *));
    if (!argv)
      goto fallback;
 
@@ -1465,6 +1465,7 @@ libvlc_new_env_args(void)
         argv[i++] = token;
         token = strtok_r(NULL, " ", &saveptr);
      }
+   argc = i;
 
    for (i = 0; i < argc; ++i)
      INF("libvlc_argv[%d]: %s", i, argv[i]);

-- 


Reply via email to