From 38735806c69f24779df7eac1338508476f0324c8 Mon Sep 17 00:00:00 2001 From: "Carsten Haitzler (Rasterman)" Date: Fri, 8 Jul 2016 11:45:07 +0900 Subject: [PATCH] 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]); -- 2.7.4