-diff's removed-name budget ignores the names the -ptr pass tested
維護者通常 1 天內回覆
評估
- 難度
- 2/5
- 預估耗時
- 1-3 小時
- 新手友好度
- 84/100
- Issue 類型
- 缺陷
- 描述清晰度
- 描述清楚
- 活躍度
- 活躍
- 技術堆疊
- go
- 領域
- cli, networking
研究方向
閱讀 internal/cli/diff.go,追蹤已刪除名稱的預算,接著檢查 internal/output/summary.go、internal/cli/summary.go 和 internal/report/ptr.go,找出記錄 PTR 掃描次數的位置。將 PTR 計數加入每個目標的預算計算,並透過測試涵蓋包含全部三個階段的一次執行。執行 go test ./internal/cli/,並確認已刪除名稱檢查維持在 -max-queries 限制內。
由索引模型根據 Issue 內容生成。
描述
Summary
-diff's check of removed names spends what is left of -max-queries per target. It subtracts the names the main pass and the -permute pass tested, but not the names the -ptr pass tested, because the report has no count of them. A run with -ptr can therefore test more names than -max-queries allows.
Where
internal/cli/diff.go(the budget:left -= t.Processed, andt.Permutation.Processed)internal/output/summary.go(TargetSummary:PTRNamescounts the names to be tested, not the ones that were)
Details
left := int64(s.f.maxQueries) * int64(len(summary.Targets))
for _, t := range summary.Targets {
left -= t.Processed
if t.Permutation != nil {
left -= t.Permutation.Processed
}
}
Since #478, -max-queries is one budget for a target's passes. The PTR pass's scan is one of them, and its tested names are missing here.
Impact
With -diff -ptr -max-queries N, the removed-name check can look up as many names again as the PTR pass tested, on top of the budget. The overshoot is small (PTR passes test few names), and affects only runs where the previous results had names this run did not find.
Steps to reproduce
- Run a scan with
-ptr -max-queries 3whose main pass tests 1 name and whose PTR pass tests 2, with-diffagainst a previous run that had two more names. - The removed-name check looks up both, for 5 names tested under a budget of 3.
Suggested fix
Record how many names the PTR pass's scan tested (a ptr_processed field next to ptr_names, or the pass's Processed kept on the session) and subtract it in the -diff budget. Add a test with all three passes.
Acceptance criteria
- The removed-name check's budget is
-max-queriesper target less the names every pass tested. - A test covers a run with
-ptr.
Getting started
- Relevant files:
internal/cli/diff.go,internal/cli/summary.go,internal/report/ptr.go - How to run tests:
go test ./internal/cli/ - Related: #478, #276
Filed by repo-audit/fix-issues at b8afd4d. Severity: low. Effort: S. audit-key: bug|internal/cli/diff.go|removed-name budget
- 主要語言
- Go
- 星號
- 1
- 分支
- 1
- 平均合併
- 10 小時
- 30 天內合併 PR
- 26
環境準備
在瀏覽器裡用你自己的 GitHub 帳號啟動這個專案的開發容器。
- 提供 Dockerfile 或 Docker Compose 檔案
- 有 Pull Request 範本
- 閱讀貢獻指南
從這裡開始
- 先讀完整個 Issue,再讀專案的貢獻指南。
- 在 Issue 下留言說明你要接手 —— 這能避免兩個人做同樣的事。
- Fork 儲存庫,在一個分支上完成修改。
- 送出 Pull Request,並在描述裡引用這個 Issue 編號。
TMHSDigital/subenum 的其他 Issue
-
area: tui bug good first issue severity: low
難度 2/5 1-3 小時 新手友好度 88/100
TMHSDigital/subenum#494 ·
維護者通常 1 天內回覆
-
security
難度 1/5 1 小時以內 新手友好度 72/100
TMHSDigital/subenum#453 ·
維護者通常 1 天內回覆
-
enhancement help wanted severity: low
難度 4/5 3-5 天 新手友好度 57/100
TMHSDigital/subenum#489 · 1 則留言 ·
維護者通常 1 天內回覆
-
area: dns enhancement severity: medium
難度 5/5 一週以上 新手友好度 35/100
TMHSDigital/subenum#477 · 1 則留言 ·
維護者通常 1 天內回覆
-
security
難度 2/5 1-3 小時 新手友好度 55/100
TMHSDigital/subenum#457 ·
維護者通常 1 天內回覆
查看 TMHSDigital/subenum 的全部 Issue
相似的 Issue
-
good first issue tools
難度 2/5 1-3 小時 新手友好度 90/100
Edwin-metcalf/MetCode#76 ·
維護者通常 1 天內回覆
-
bug effort:s impact:med raised-by:worker risk:low to:worker
難度 2/5 1-3 小時 新手友好度 78/100
medici-finance/assay#8120 · 1 則留言 ·
維護者通常 1 天內回覆
-
factory:subtask
難度 1/5 1 小時以內 新手友好度 72/100
維護者通常 1 天內回覆
-
reportedBy/community
難度 2/5 1-3 小時 新手友好度 78/100
openchoreo/openchoreo#5751 ·
維護者通常 1 天內回覆
-
難度 2/5 1-3 小時 新手友好度 77/100
agent-substrate/substrate#4308 ·
維護者通常 2 天內回覆