Skip to content

core: fix /start remote host parser when iface name contains a space#7025

Merged
epoberezkin merged 2 commits into
stablefrom
nd/fix-space-in-interface
May 30, 2026
Merged

core: fix /start remote host parser when iface name contains a space#7025
epoberezkin merged 2 commits into
stablefrom
nd/fix-space-in-interface

Conversation

@Narasimha-sc
Copy link
Copy Markdown
Collaborator

Problem. Picking a non-default network interface (e.g. Windows Ethernet 2) on the "Link a mobile" screen and refreshing the QR code fails with error chat: error chat commandError Failed reading: empty.

Cause. rcCtrlAddressP parsed the iface value with jsonP (which consumes all remaining bytes via A.takeByteString then strict-decodes JSON); when port=… follows, the strict decode rejects the trailing data and the text1P fallback stops at the first space — inside the JSON quotes — leaving garbage that breaks endOfInput.

Fix. Replace jsonP with a bounded quotedP that consumes only "…" so port=… stays available for the next parser; added a pure regression test for iface="Ethernet 2" port=12345.

@Narasimha-sc Narasimha-sc requested a review from epoberezkin as a code owner May 29, 2026 09:58
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.
@epoberezkin epoberezkin force-pushed the nd/fix-space-in-interface branch from 48d8a6b to 45ce121 Compare May 30, 2026 06:32
@epoberezkin epoberezkin changed the base branch from master to stable May 30, 2026 06:32
@epoberezkin epoberezkin merged commit 5aace84 into stable May 30, 2026
9 of 12 checks passed
@epoberezkin epoberezkin deleted the nd/fix-space-in-interface branch May 30, 2026 06:33
@github-actions github-actions Bot locked and limited conversation to collaborators May 30, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants