summaryrefslogtreecommitdiff
path: root/src/modules/emotion/libvlc
diff options
context:
space:
mode:
authorCarsten Haitzler (Rasterman) <raster@rasterman.com>2016-07-08 11:45:07 +0900
committerCarsten Haitzler (Rasterman) <raster@rasterman.com>2016-07-08 11:45:07 +0900
commit38735806c69f24779df7eac1338508476f0324c8 (patch)
tree86761e5f8556265b34e271a8c30697b95eaec00e /src/modules/emotion/libvlc
parent28dc4e64e2b2bf4c41676a3c92467bdc8a90a326 (diff)
emotion libvlc module - fix possible argv init issue with tokens
fixes CID 1357170
Diffstat (limited to 'src/modules/emotion/libvlc')
-rw-r--r--src/modules/emotion/libvlc/emotion_libvlc.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/modules/emotion/libvlc/emotion_libvlc.c b/src/modules/emotion/libvlc/emotion_libvlc.c
index c550551a62..3c7345169a 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)
1449 goto fallback; 1449 goto fallback;
1450 1450
1451 /* alloc argv */ 1451 /* alloc argv */
1452 argv = malloc(argc * sizeof(char *)); 1452 argv = calloc(1, argc * sizeof(char *));
1453 if (!argv) 1453 if (!argv)
1454 goto fallback; 1454 goto fallback;
1455 1455
@@ -1465,6 +1465,7 @@ libvlc_new_env_args(void)
1465 argv[i++] = token; 1465 argv[i++] = token;
1466 token = strtok_r(NULL, " ", &saveptr); 1466 token = strtok_r(NULL, " ", &saveptr);
1467 } 1467 }
1468 argc = i;
1468 1469
1469 for (i = 0; i < argc; ++i) 1470 for (i = 0; i < argc; ++i)
1470 INF("libvlc_argv[%d]: %s", i, argv[i]); 1471 INF("libvlc_argv[%d]: %s", i, argv[i]);