Sisyphus repository
Last update: 1 october 2023 | SRPMs: 18631 | Visits: 37789984
en ru br
ALT Linux repos
S:4.4.0-alt2
5.0: 3.81-alt2
4.1: 3.81-alt2
4.0: 3.81-alt2
3.0: 3.81beta3-alt4

Group :: Development/Other
RPM: make

 Main   Changelog   Spec   Patches   Sources   Download   Gear   Bugs and FR  Repocop 

Patch: make-3.82-cvs-27.patch
Download


2012-09-09  Paul Smith  <psmith@gnu.org>
	* job.c (construct_command_argv_internal): Keep the command line
	on the heap for very long lines.  Fixes Savannah bug #36451.
--- a/job.c
+++ b/job.c
@@ -2984,8 +2984,8 @@ construct_command_argv_internal (char *line, char **restp, char *shell,
 	return new_argv;
       }
 
-    new_line = alloca ((shell_len*2) + 1 + sflags_len + 1
-                             + (line_len*2) + 1);
+    new_line = xmalloc ((shell_len*2) + 1 + sflags_len + 1
+                        + (line_len*2) + 1);
     ap = new_line;
     /* Copy SHELL, escaping any characters special to the shell.  If
        we don't escape them, construct_command_argv_internal will
@@ -3052,8 +3052,11 @@ construct_command_argv_internal (char *line, char **restp, char *shell,
 	*ap++ = *p;
       }
     if (ap == new_line + shell_len + sflags_len + 2)
-      /* Line was empty.  */
-      return 0;
+      {
+        /* Line was empty.  */
+        free (new_line);
+        return 0;
+      }
     *ap = '\0';
 
 #ifdef WINDOWS32
@@ -3194,6 +3197,8 @@ construct_command_argv_internal (char *line, char **restp, char *shell,
       fatal (NILF, _("%s (line %d) Bad shell context (!unixy && !batch_mode_shell)\n"),
             __FILE__, __LINE__);
 #endif
+
+    free (new_line);
   }
 #endif	/* ! AMIGA */
 
 
design & coding: Vladimir Lettiev aka crux © 2004-2005, Andrew Avramenko aka liks © 2007-2008
current maintainer: Michael Shigorin