URL: <http://savannah.gnu.org/bugs/?45838>
Summary: Memory corruption when recipe runs a batch file with spaces in path Project: make Submitted by: None Submitted on: Thu 27 Aug 2015 16:07:05 UTC Severity: 3 - Normal Item Group: Bug Status: None Privacy: Public Assigned to: None Open/Closed: Open Discussion Lock: Any Component Version: 4.1 Operating System: MS Windows Fixed Release: None Triage Status: None _______________________________________________________ Details: On 4.1, when trying to run a batch file from a recipe, and that batch file has a space in its path, strange command line corruption appears. The problem did not exist in 3.82. I'm building make from sources on Windows with MSVC. I rebuilt in debug and ran the code through a debugger. It turns out that the problem is in file sub_proc.c, in function process_begin, at line 725 (in 4.1 and current git head). The code wants to free argv[0] and replace it with something else. However all strings in argv are in a single memory block, so freeing argv[0] also frees subsequent argv[n] strings, and the memory doesn't always hold the argument content until they are used. _______________________________________________________ Reply to this item at: <http://savannah.gnu.org/bugs/?45838> _______________________________________________ Message sent via/by Savannah http://savannah.gnu.org/ _______________________________________________ Bug-make mailing list Bug-make@gnu.org https://lists.gnu.org/mailman/listinfo/bug-make