Skip to content

plugin/loop: avoid panic on invalid server block#7568

Merged
yongtang merged 1 commit into
coredns:masterfrom
thevilledev:fix/loop-panic
Sep 22, 2025
Merged

plugin/loop: avoid panic on invalid server block#7568
yongtang merged 1 commit into
coredns:masterfrom
thevilledev:fix/loop-panic

Conversation

@thevilledev

@thevilledev thevilledev commented Sep 21, 2025

Copy link
Copy Markdown
Collaborator

1. Why is this pull request needed and what does it do?

Ignore invalid ServerBlockKeys in loop plugin that fail normalization. Retain the default “.” zone instead of indexing into an empty slice. This prevents an index-out-of-range panic triggered by malformed inputs such as "unix://".

Added a test to validate and increase test coverage. Increases test coverage from 32.1% to 65.1%.

2. Which issues (if any) are related?

Fixes OSS-Fuzz finding #446421108. Currently not publicly accessible.

3. Which documentation changes (if any) need to be made?

None.

4. Does this introduce a backward incompatible change or deprecation?

No.

@codecov

codecov Bot commented Sep 21, 2025

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 62.57%. Comparing base (93c57b6) to head (49967de).
⚠️ Report is 1658 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #7568      +/-   ##
==========================================
+ Coverage   55.70%   62.57%   +6.87%     
==========================================
  Files         224      274      +50     
  Lines       10016    18327    +8311     
==========================================
+ Hits         5579    11469    +5890     
- Misses       3978     6190    +2212     
- Partials      459      668     +209     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@thevilledev

thevilledev commented Sep 21, 2025

Copy link
Copy Markdown
Collaborator Author

I'll add some more unit tests while at it.

EDIT: done ✔️

Ignore invalid ServerBlockKeys in loop plugin that fail
normalization. Retain the default “.” zone instead of
indexing into an empty slice. This prevents an
index-out-of-range panic triggered by malformed
inputs such as "unix://".

Added tests to validate and increase test coverage.

Signed-off-by: Ville Vesilehto <ville@vesilehto.fi>
@yongtang yongtang merged commit 31e2859 into coredns:master Sep 22, 2025
13 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.

2 participants