Fix out of bound array access in native-wrappers.h

This commit is contained in:
Michael Hept authored and Martin Storsjö committed 2019-05-09 14:58:38 +03:00
1 parent d009355b91
commit a959509701
1 file changed
+1 -1
+1 -1
View File
@@ -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;