Patch for run-1.3.0-1 core dump

foo ggl329@gmail.com
Sat Aug 10 17:35:00 GMT 2013


Hi,

Whenever I execute run.exe, it generates run.exe.stackdump.

At line 370 in run.c, run2_freeargv() tries to free newargv, and
run2_freeqrgv() expects that newargv is terminated by NULL. However,
in shifting newargv at line 253-256, it fails to shift NULL
terminator. Therefore, run2_freeargv() frees memory illegally.
The following patch is a workaround.

--- run.c.old
+++ run.c.new
@@ -252,7 +252,7 @@
       newargv = run2_dupargv (argv);
       /* discard newargv[0] and shift up */
       free (newargv[0]);
-      for (newargc = 1; newargc < argc; newargc++)
+      for (newargc = 1; newargv[newargc-1] != NULL; newargc++)
          newargv[newargc-1] = newargv[newargc];
       newargc = argc - 1;


Regards,

---
   ggl329

--
Problem reports:       http://cygwin.com/problems.html
FAQ:                   http://cygwin.com/faq/
Documentation:         http://cygwin.com/docs.html
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple



More information about the Cygwin mailing list