core: fix /start remote host parser when iface name contains a space#7025
Merged
Conversation
The iface= field used jsonP (which calls takeByteString and strict-decodes the entire remaining input as JSON). When port= followed iface=, the strict decode failed on the trailing data and the text1P fallback stopped at the first space inside the JSON-quoted interface name (e.g. "Ethernet 2"), leaving unparseable junk and producing "Failed reading: empty". Replace jsonP with a bounded quotedP that consumes only up to the closing quote, leaving port=… for the next parser.
48d8a6b to
45ce121
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem. Picking a non-default network interface (e.g. Windows
Ethernet 2) on the "Link a mobile" screen and refreshing the QR code fails witherror chat: error chat commandError Failed reading: empty.Cause.
rcCtrlAddressPparsed the iface value withjsonP(which consumes all remaining bytes viaA.takeByteStringthen strict-decodes JSON); whenport=…follows, the strict decode rejects the trailing data and thetext1Pfallback stops at the first space — inside the JSON quotes — leaving garbage that breaksendOfInput.Fix. Replace
jsonPwith a boundedquotedPthat consumes only"…"soport=…stays available for the next parser; added a pure regression test foriface="Ethernet 2" port=12345.