Skip to content

libmdnsd: guard NULL decoded names in _cache() - #97

Merged
troglobit merged 1 commit into
troglobit:masterfrom
jpfr:fix_cache
Jul 27, 2026
Merged

libmdnsd: guard NULL decoded names in _cache()#97
troglobit merged 1 commit into
troglobit:masterfrom
jpfr:fix_cache

Conversation

@jpfr

@jpfr jpfr commented Jul 24, 2026

Copy link
Copy Markdown
Contributor

Malformed name and SRV records can leave their decoded target name NULL. _cache() passes these names to strdup(), causing a remotely reachable null-pointer dereference.

Reject these records and release the partially allocated cache entry.

@troglobit troglobit left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

Two minor changes that make the code slightly cleaner and matches project style.

Comment thread libmdnsd/mdnsd.c
Comment thread libmdnsd/mdnsd.c
Malformed name and SRV records can leave their decoded target name NULL.  _cache() passes these names to strdup(), causing a remotely reachable null-pointer dereference.

Reject these records and release the partially allocated cache entry.

Signed-off-by: Julius Pfrommer <julius.pfrommer@o6-automation.com>
@jpfr

jpfr commented Jul 27, 2026

Copy link
Copy Markdown
Contributor Author

Done

@troglobit

Copy link
Copy Markdown
Owner

Done

Perfect, thanks! New release in a few days 😃

@troglobit
troglobit merged commit ff54936 into troglobit:master Jul 27, 2026
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants