From: Carsten Haitzler (Rasterman) Date: Fri, 8 Jul 2016 02:45:07 +0000 (+0900) Subject: emotion libvlc module - fix possible argv init issue with tokens X-Git-Tag: upstream/1.20.0~5316 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=38735806c69f24779df7eac1338508476f0324c8;p=platform%2Fupstream%2Fefl.git emotion libvlc module - fix possible argv init issue with tokens fixes CID 1357170 --- 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]);