New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix: prevent print crash on bad deviceName #21946
Conversation
8fde28f
to
261f6d2
Compare
261f6d2
to
f513be4
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
23602ee
to
9da6bcc
Compare
9da6bcc
to
a0fde37
Compare
a0fde37
to
858dbc6
Compare
Release Notes Persisted
|
I was unable to backport this PR to "7-1-x" cleanly; |
I was unable to backport this PR to "6-1-x" cleanly; |
I have automatically backported this PR to "8-x-y", please check out #21982 |
* fix: prevent print crash on bad deviceName * address review feedback
@codebytere has manually backported this PR to "7-1-x", please check out #22012 |
Description of Change
On Windows and macOS, Chromium's printing code will crash if a
deviceName
is provided, but is invalid on the network, i.e does not correspond to a printer that the caller machine is aware of. This bug has been present for a long time, but after playing around a bit I've determined that it's possible to catch faultydeviceName
s by pulling out some of the printer validation code from Chromium. This PR adds that check for Windows and macOS as well as tests for the same.Tested with:
cc @ckerr @zcbenz
Checklist
npm test
passesRelease Notes
Notes: Fixed a potential crash on faulty
deviceName
s inwebContents.print()
.