Skip to content

contrib: skip truncated makeseeds input lines - #290

Draft
l0rinc wants to merge 2 commits into
masterfrom
fix/makeseeds-field-count-off-by-one
Draft

l0rinc wants to merge 2 commits into
masterfrom
fix/makeseeds-field-count-off-by-one

Conversation

@l0rinc

@l0rinc l0rinc commented Sep 2, 2026

Copy link
Copy Markdown
Owner

Problem: makeseeds.py expects 12 fields in each DNS seeder line, but accepts lines with 11 fields and then reads the missing user agent. A truncated line with exactly 11 fields therefore raises IndexError and aborts the run.

Fix: Require all 12 fields so truncated lines are skipped. Add inline unit tests covering valid and truncated lines.

Fixes bitcoin#36146

Record that a valid 12-field seeder line parses, that shorter lines are skipped, and that a line missing only the user agent still aborts the run.
DNS seeder lines contain 12 whitespace-separated fields ending with the user agent. `parseline()` skipped only lines with fewer than 11 fields but reads the user agent from `sline[11]`.

A truncated line with exactly 11 fields therefore raised `IndexError` and aborted the run after the asmap database was loaded. Require all 12 fields so truncated lines are skipped.
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.

contrib: makeseeds.py parseline() raises IndexError on lines with exactly 11 fields

2 participants