← スキル一覧に戻る

detecting-off-by-one
by waiwai24
⭐ 1🍴 0📅 2026年1月4日
SKILL.md
name: detecting-off-by-one description: Detects off-by-one errors by identifying incorrect loop conditions, array indexing mistakes, and boundary condition problems. Use when analyzing loops, array access, or investigating fencepost errors.
Off-by-One Detection
Detection Workflow
- Identify array operations: Find all array accesses, loop iterations, buffer allocations, string operations
- Analyze boundary conditions: Check loop termination conditions, array index ranges, buffer size calculations
- Check edge cases: Test boundary conditions, verify fencepost cases, assess null terminator handling
- Assess impact: Can off-by-one cause overflow/underflow? What's the security impact?
Key Patterns
- Loop bound errors: using <= instead of <, or < instead of <=
- Array index errors: accessing array[size] instead of array[size-1]
- String handling errors: missing null terminator, incorrect buffer size
- Allocation errors: allocating size instead of size+1
Output Format
Report with: id, type, subtype, severity, confidence, location, vulnerability, loop condition, array access, array size, error type, exploitability, attack scenario, impact, mitigation.
Severity Guidelines
- HIGH: Off-by-one causing buffer overflow
- MEDIUM: Off-by-one causing information disclosure
- LOW: Off-by-one with minor impact
See Also
patterns.md- Detailed detection patterns and exploitation scenariosexamples.md- Example analysis cases and code samplesreferences.md- CWE references and mitigation strategies
スコア
総合スコア
55/100
リポジトリの品質指標に基づく評価
✓SKILL.md
SKILL.mdファイルが含まれている
+20
✓LICENSE
ライセンスが設定されている
+10
○説明文
100文字以上の説明がある
0/10
○人気
GitHub Stars 100以上
0/15
○最近の活動
3ヶ月以内に更新がある
0/10
○フォーク
10回以上フォークされている
0/5
✓Issue管理
オープンIssueが50未満
+5
○言語
プログラミング言語が設定されている
0/5
○タグ
1つ以上のタグが設定されている
0/5
レビュー
💬
レビュー機能は近日公開予定です