forked from enlightenment/efl
emotion libvlc module - fix possible argv init issue with tokens
fixes CID 1357170
This commit is contained in:
parent
28dc4e64e2
commit
38735806c6
|
@ -1449,7 +1449,7 @@ libvlc_new_env_args(void)
|
||||||
goto fallback;
|
goto fallback;
|
||||||
|
|
||||||
/* alloc argv */
|
/* alloc argv */
|
||||||
argv = malloc(argc * sizeof(char *));
|
argv = calloc(1, argc * sizeof(char *));
|
||||||
if (!argv)
|
if (!argv)
|
||||||
goto fallback;
|
goto fallback;
|
||||||
|
|
||||||
|
@ -1465,6 +1465,7 @@ libvlc_new_env_args(void)
|
||||||
argv[i++] = token;
|
argv[i++] = token;
|
||||||
token = strtok_r(NULL, " ", &saveptr);
|
token = strtok_r(NULL, " ", &saveptr);
|
||||||
}
|
}
|
||||||
|
argc = i;
|
||||||
|
|
||||||
for (i = 0; i < argc; ++i)
|
for (i = 0; i < argc; ++i)
|
||||||
INF("libvlc_argv[%d]: %s", i, argv[i]);
|
INF("libvlc_argv[%d]: %s", i, argv[i]);
|
||||||
|
|
Loading…
Reference in New Issue