Skip to content

fix: use proper quoting for exe paths and args on Windows - #50016

Merged
jkleinsc merged 1 commit into
mainfrom
quote-right
Mar 4, 2026
Merged

jkleinsc merged 1 commit into
mainfrom
quote-right

Conversation

@codebytere

@codebytere codebytere commented Mar 2, 2026 •

Copy link
Copy Markdown
Member

Description of Change

Previously, GetProtocolLaunchPath and FormatCommandLineString in browser_win.cc used naive quoting which could break when paths or arguments contained backslashes, spaces, or embedded quotes.

Fix by extracting the CommandLineToArgvW-compatible quoting logic from relauncher_win.cc into a shared utility (shell/common/command_line_util_win) and use it in both browser_win.cc and relauncher_win.cc to properly quote the exe path and each argument individually.

Checklist

Release Notes

Notes: none

@electron-cation electron-cation Bot added the new-pr 🌱 PR opened recently label Mar 2, 2026
@jkleinsc jkleinsc added the semver/patch backwards-compatible bug fixes label Mar 2, 2026
@electron-cation electron-cation Bot removed the new-pr 🌱 PR opened recently label Mar 3, 2026
Previously, GetProtocolLaunchPath and FormatCommandLineString in
browser_win.cc used naive quoting which could break when paths or
arguments contained backslashes, spaces, or embedded quotes.

Fix by extracting the CommandLineToArgvW-compatible quoting logic from
relauncher_win.cc into a shared utility and use it in both browser_win.cc
and relauncher_win.cc to properly quote the exe path and each argument
individually.
@codebytere codebytere added target/39-x-y PR should also be added to the "39-x-y" branch. target/40-x-y PR should also be added to the "40-x-y" branch. target/41-x-y PR should also be added to the "41-x-y" branch. labels Mar 4, 2026
@jkleinsc
jkleinsc merged commit f750744 into main Mar 4, 2026
119 of 120 checks passed
@release-clerk

release-clerk Bot commented Mar 4, 2026

Copy link
Copy Markdown

No Release Notes

@trop

trop Bot commented Mar 4, 2026

Copy link
Copy Markdown
Contributor

I have automatically backported this PR to "39-x-y", please check out #50074

@trop

trop Bot commented Mar 4, 2026

Copy link
Copy Markdown
Contributor

I have automatically backported this PR to "40-x-y", please check out #50075

@trop trop Bot added in-flight/39-x-y in-flight/40-x-y and removed target/39-x-y PR should also be added to the "39-x-y" branch. target/40-x-y PR should also be added to the "40-x-y" branch. labels Mar 4, 2026
@trop

trop Bot commented Mar 4, 2026

Copy link
Copy Markdown
Contributor

I have automatically backported this PR to "41-x-y", please check out #50076

@trop trop Bot added in-flight/41-x-y merged/39-x-y PR was merged to the "39-x-y" branch. and removed target/41-x-y PR should also be added to the "41-x-y" branch. in-flight/39-x-y labels Mar 4, 2026
@trop trop Bot added merged/41-x-y PR was merged to the "41-x-y" branch. merged/40-x-y PR was merged to the "40-x-y" branch. and removed in-flight/41-x-y in-flight/40-x-y labels Mar 4, 2026
@MarshallOfSound

Copy link
Copy Markdown
Member

/trop run backport-to 38-x-y

@trop

trop Bot commented Mar 9, 2026

Copy link
Copy Markdown
Contributor

The backport process for this PR has been manually initiated - sending your PR to 38-x-y!

@trop

trop Bot commented Mar 9, 2026

Copy link
Copy Markdown
Contributor

I have automatically backported this PR to "38-x-y", please check out #50146

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

merged/38-x-y PR was merged to the "38-x-y" branch. merged/39-x-y PR was merged to the "39-x-y" branch. merged/40-x-y PR was merged to the "40-x-y" branch. merged/41-x-y PR was merged to the "41-x-y" branch. semver/patch backwards-compatible bug fixes

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants