-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数をターゲットごとの予算計算に加え、3つすべてのパスを実行するケースをテストで網羅してください。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時間
- マージ済み PR(30日)
- 26
環境構築
このプロジェクトの開発コンテナを、あなたの GitHub アカウントでブラウザ上に起動します。
- Dockerfile または Docker Compose ファイルあり
- プルリクエストのテンプレートあり
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- 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 1週間以上 初心者へのやさしさ 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 日以内に返信