Skip to content

dnscache: check hostname on lookup - #23169

Closed
icing wants to merge 3 commits into
curl:masterfrom
icing:dnscache-key-check
Closed

icing wants to merge 3 commits into
curl:masterfrom
icing:dnscache-key-check

Conversation

@icing

@icing icing commented Sep 29, 2026

Copy link
Copy Markdown
Contributor

Since dnscache keys may truncate hostnames longer than MAX_HOSTCACHE_LEN, re-check the hostname of a found entry on lookup if it is indeed for the intended peer and ignore it otherwise.

reported-by: Joshua Rogers

@github-actions github-actions Bot added the name lookup DNS and related tech label Sep 29, 2026
@icing
icing requested a review from bagder September 29, 2026 12:20
Comment thread lib/vdns/dnscache.c Resolved
Since dnscache keys may truncate hostnames longer than `MAX_HOSTCACHE_LEN`,
re-check the hostname of a found entry on lookup if it is indeed for
the intended peer and ignore it otherwise.

reported-by: Joshua Rogers
Use already initialized `dnsc_id` which has known name length.
Do not string compare when length it below truncation limit.
@icing
icing force-pushed the dnscache-key-check branch from 7fc7e5d to 69b08f4 Compare September 30, 2026 11:20
@curl curl deleted a comment from testclutch Sep 30, 2026
@icing
icing requested a review from jay September 30, 2026 12:21
@jay jay closed this in 62a6ee5 Oct 1, 2026
@jay

jay commented Oct 1, 2026

Copy link
Copy Markdown
Member

Thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

name lookup DNS and related tech

Development

Successfully merging this pull request may close these issues.

2 participants