fix(display): reject trailing X11 display input - #1797
Conversation
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: unbridled-41 The full list of commands accepted by this bot can be found here. DetailsNeeds approval from an approver in each of these files:Approvers can indicate their approval by writing |
|
Hi @unbridled-41. Thanks for your PR. I'm waiting for a OpenAtom-Linyaps member to verify that this patch is reasonable to test. If it is, they should reply with Once the patch is verified, the new status will be reflected by the I understand the commands that are listed here. DetailsInstructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
Require display and screen numbers to consume their complete input. This prevents malformed DISPLAY values with trailing characters or extra segments from being silently accepted. Add coverage for hostname and Unix-socket forms. Signed-off-by: 做着百万梦的鱼 <yangzihao_41@outlook.com>
80dac00 to
e125710
Compare
Summary
Reject malformed X11
DISPLAYvalues containing trailing characters or extra numeric segments.Root cause
std::stoi()was used without checking how many characters it consumed. Inputs such aslocalhost:0junkandlocalhost:0.1junkwere therefore accepted because their numeric prefixes parsed successfully and the remaining characters were ignored.Changes
Reproduction
Call
getXOrgDisplay("localhost:0junk"). Before this change it returns a parsed display number of 0; after this change it returns an error.Test plan
git diff --check