Re: [PATCH v3] Cygwin: ssp: Move command-line copy into run_program
Jon Turney <[email protected]> Tue, 30 Jun 2026 19:18:50 +0100
| Newsgroups | gmane.os.cygwin.patches |
|---|---|
| Message-ID | <[email protected]> |
On 25/06/2026 15:33, Chandru Kumaresan wrote: > Hi Jon, > >> Hmmm... from the explanation above, it seems like this is in the wrong >> place and should be inside run_program, around the call to CreateProcess? >> Otherwise, the same pointer which is passed to CreateProcess and >> potentially has its contents mutated by that is also assigned to >> dll_info[0].name, leading to a potentially corrupted string appearing in >> the DLL-profile table. >> If that supposition is correct, I'd appreciate it if you could come up >> with a follow-up patch to change that. > > You are correct — moving the strdup into run_program, just before the > CreateProcess call, is the right fix. Please find the follow-up patch below. Great, thanks. Pushed! This actually looks kind of like a Windows aarch64 bug, since the MSDN page for CreateProcessA() now says (and I seem to remember that text has been there a long time) about lpCommandLine: "The Unicode version of this function, CreateProcessW, can modify the contents of this string." The implication being that CreateProcessA does not modify its lpCommandLine parameter.