We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Describe the bug
SCC crashes with a nil pointer dereference in processor/workers.go line 450 if --no-duplicates is specified and one of the files is empty. This is because CountStats skips initializing the hash object if the file is empty.
--no-duplicates
To Reproduce
$ mkdir test && cd test $ touch go.c $ scc --no-duplicates panic: runtime error: invalid memory address or nil pointer dereference [signal SIGSEGV: segmentation violation code=0x1 addr=0x30 pc=0x1222b51] goroutine 11 [running]: github.com/boyter/scc/v3/processor.processFile(0xc0000da000, 0xc000096048) /Users/fluggo/software/extern/scc/processor/workers.go:450 +0x171 github.com/boyter/scc/v3/processor.fileProcessorWorker.func1(0xc000028540, 0xc00037e2b0, 0xc00037e2b8, 0xc00037e2c0, 0xc000028600, 0xc00037e2d0) /Users/fluggo/software/extern/scc/processor/workers.go:375 +0x30b created by github.com/boyter/scc/v3/processor.fileProcessorWorker /Users/fluggo/software/extern/scc/processor/workers.go:346 +0xfc $ echo thing > go.c $ scc --no-duplicates ─────────────────────────────────────────────────────────────────────────────── Language Files Lines Blanks Comments Code Complexity ─────────────────────────────────────────────────────────────────────────────── C 1 1 0 0 1 0 ─────────────────────────────────────────────────────────────────────────────── Total 1 1 0 0 1 0 ─────────────────────────────────────────────────────────────────────────────── Estimated Cost to Develop (organic) $19 Estimated Schedule Effort (organic) 0.221524 months Estimated People Required (organic) 0.007670 ─────────────────────────────────────────────────────────────────────────────── Processed 6 bytes, 0.000 megabytes (SI) ───────────────────────────────────────────────────────────────────────────────
Desktop (please complete the following information):
The text was updated successfully, but these errors were encountered:
Oh that's not good. Investigating now.
Sorry, something went wrong.
cb04a8d
Fix sitting in master for it with a integration test.
Verified. Thank you!
Neat!
No branches or pull requests
Describe the bug
SCC crashes with a nil pointer dereference in processor/workers.go line 450 if
--no-duplicates
is specified and one of the files is empty. This is because CountStats skips initializing the hash object if the file is empty.To Reproduce
Desktop (please complete the following information):
The text was updated successfully, but these errors were encountered: