Skip to content

[bug-report] Crash when using non-file argument to -f #29

Closed
@TLINDEN

Description

A call like this:

tablizer -f "DESCRIPTION=(foo|bar)"

leads to:

panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x18 pc=0x89caee]

goroutine 1 [running]:
github.com/tlinden/tablizer/cfg.(*Config).ParseConfigfile(0xc000102c40)
        /home/scip/dev/tablizer/cfg/config.go:331 +0x6e
github.com/tlinden/tablizer/cmd.Execute.func1(0xc00020ea00?, {0xc000164540, 0x0, 0xc})
        /home/scip/dev/tablizer/cmd/root.go:109 +0x7d
github.com/spf13/cobra.(*Command).execute(0xc000222308, {0xc0001201b0, 0xc, 0xc})
        /home/scip/go/pkg/mod/github.com/spf13/[email protected]/command.go:989 +0xab1
github.com/spf13/cobra.(*Command).ExecuteC(0xc000222308)
        /home/scip/go/pkg/mod/github.com/spf13/[email protected]/command.go:1117 +0x3ff
github.com/spf13/cobra.(*Command).Execute(...)
        /home/scip/go/pkg/mod/github.com/spf13/[email protected]/command.go:1041
github.com/tlinden/tablizer/cmd.Execute()
        /home/scip/dev/tablizer/cmd/root.go:201 +0xb65
main.main()
        /home/scip/dev/tablizer/main.go:25 +0xf

The user meant to supply a filter arg, but that would be -F not -f which is being treated as a config file, but should lead to a meaningful error message, not a crash.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Assignees

Labels

bugSomething isn't working

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions