Skip to content

fix(mdns): Fix parsing of mdns.txt records containing booleans#1038

Merged
david-cermak merged 1 commit intoespressif:masterfrom
frankencode:master
Apr 10, 2026
Merged

fix(mdns): Fix parsing of mdns.txt records containing booleans#1038
david-cermak merged 1 commit intoespressif:masterfrom
frankencode:master

Conversation

@frankencode
Copy link
Copy Markdown
Contributor

@frankencode frankencode commented Mar 29, 2026

RFC 6763 / page 16 explicitly allows booleans without '='. Failing to parse these caused mdns_query_txt() to return a null pointer. This is a simple and straight-forward fix for the scan index stepping correctly when no '=' is present.

Testing

I did positive and negative testing by changing a boolean in the mdns.txt record of the target host.
I did test it with a "register=true" and then again with just a "register" txt record.
Without this single-line patch the latter would fail to parse when calling mdns_query_txt().


Note

Medium Risk
Touches mDNS TXT record parsing on incoming network packets; a small index-calculation change could affect how subsequent TXT entries/values are read for edge-case inputs.

Overview
Fixes parsing of mDNS TXT records that omit '=' (RFC 6763 boolean-style keys) by advancing the scan index only when an equals sign is actually present. This prevents boolean TXT entries like "register" from breaking TXT parsing and returning missing/NULL results.

Written by Cursor Bugbot for commit a6e0951. This will update automatically on new commits. Configure here.

RFC 6763 / page 16 explicitly allows booleans without '='.
Failing to parse these caused mdns_query_txt() to return a null pointer.
This is a simple and straight-forward fix for the scan index stepping
correctly when no '=' is present.

Signed-off-by: Frank Mertens <frank@cyblogic.de>
@CLAassistant
Copy link
Copy Markdown

CLAassistant commented Mar 29, 2026

CLA assistant check
All committers have signed the CLA.

@espressif-bot espressif-bot added the Status: Opened Issue is new label Mar 29, 2026
Copy link
Copy Markdown
Collaborator

@david-cermak david-cermak left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for the fix!

@david-cermak david-cermak merged commit d63ce49 into espressif:master Apr 10, 2026
213 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants