changeset 29622:07dc3ad56d74 stable

unistd-wrappers.c: Allocate sufficient memory for new_argv (bug #60535). * liboctave/wrappers/unistd-wrappers.c: Multiply number of elements in malloc for new_argv by size of char *.
author Gene Harvey <gharveymn@gmail.com>
date Thu, 06 May 2021 00:31:57 -0500
parents 69b6b783a8ab
children a49e8c0ce9a3 9c76a6aefb42
files liboctave/wrappers/unistd-wrappers.c
diffstat 1 files changed, 1 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/liboctave/wrappers/unistd-wrappers.c	Wed May 05 14:26:44 2021 -0700
+++ b/liboctave/wrappers/unistd-wrappers.c	Thu May 06 00:31:57 2021 -0500
@@ -166,7 +166,7 @@
     ;
 
   /* Allocate new argument vector.  */
-  new_argv = (char **) malloc (argc + 1);
+  new_argv = (char **) malloc ((argc + 1) * sizeof (char *));
 
   /* Put quoted arguments into the new argument vector.  */
   for (i = 0; i < argc; i++)