Commit 063ae32
fix(scan): Normalize project path to absolute before building callgraph
Fixed critical bug where scan command failed to index any functions in the
callgraph when using relative paths (e.g., --project .).
Root Cause:
- graph.Initialize() created nodes with relative file paths
- BuildModuleRegistry() converted paths to absolute internally
- indexFunctions() couldn't match relative paths to absolute paths
- All functions skipped, resulting in 0 vulnerabilities detected
Solution:
Convert projectPath to absolute using filepath.Abs() before passing to
both graph.Initialize() and callgraph.BuildCallGraph() to ensure
consistent path representation throughout the pipeline.
Impact:
- Before: "indexed 0, skipped_registry=1149" (0 functions)
- After: "indexed 1149, skipped_registry=0" (all functions)
- Integration test now correctly detects vulnerabilities
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>1 parent 523e005 commit 063ae32
1 file changed
Lines changed: 8 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
4 | 4 | | |
5 | 5 | | |
6 | 6 | | |
| 7 | + | |
7 | 8 | | |
8 | 9 | | |
9 | 10 | | |
| |||
34 | 35 | | |
35 | 36 | | |
36 | 37 | | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
37 | 45 | | |
38 | 46 | | |
39 | 47 | | |
| |||
0 commit comments