Skip to content

fix: zero-initialize prefetch query options in cache timer callbacks#477

Open
PikuZheng wants to merge 13 commits into
masterfrom
codex/analyze-and-fix-cache-timer-issue
Open

fix: zero-initialize prefetch query options in cache timer callbacks#477
PikuZheng wants to merge 13 commits into
masterfrom
codex/analyze-and-fix-cache-timer-issue

Conversation

@PikuZheng

Copy link
Copy Markdown
Owner

Motivation

  • Prevent timer-triggered prefetch from reusing stale stack data in dns_server_query_option, which can cause accumulated/contaminated request options and unexplained memory growth when the cache timer fires.

Description

  • Zero-initialize the stack struct dns_server_query_option in the cache prefetch callbacks by changing to struct dns_server_query_option server_query_option = {0}; in _dns_server_prefetch_domain and _dns_server_prefetch_expired_domain in src/dns_server/prefetch.c so each timer execution starts from a clean state.

Testing

  • Built the project with make -C src -j4, which completed successfully (compile warnings unrelated to this change were present but the build succeeded).

Codex Task

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

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant