Fix out of bound array access in native-wrappers.h
This commit is contained in:
1 parent
d009355b91
commit
a959509701
1 file changed
+1
-1
@@ -88,7 +88,7 @@ static int _tspawnvp_escape(int mode, const TCHAR *filename, const TCHAR * const
|
||||
int num_args = 0;
|
||||
while (argv[num_args])
|
||||
num_args++;
|
||||
const TCHAR **escaped_argv = malloc(num_args * sizeof(*escaped_argv));
|
||||
const TCHAR **escaped_argv = malloc((num_args + 1) * sizeof(*escaped_argv));
|
||||
for (int i = 0; argv[i]; i++)
|
||||
escaped_argv[i] = escape(argv[i]);
|
||||
escaped_argv[num_args] = NULL;
|
||||
|
||||
Reference in new issue
Block a user