Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

regal fix segfaults on missing .regal dir #1341

Closed
grosser opened this issue Jan 16, 2025 · 1 comment · Fixed by #1343
Closed

regal fix segfaults on missing .regal dir #1341

grosser opened this issue Jan 16, 2025 · 1 comment · Fixed by #1343

Comments

@grosser
Copy link

grosser commented Jan 16, 2025

regal fix emptyfile.rego
panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x2 addr=0x0 pc=0x102bca9b0]

goroutine 1 [running]:
os.(*File).Name(...)
	/home/runner/go/pkg/mod/golang.org/toolchain@v0.0.1-go1.23.3.linux-amd64/src/os/file.go:62
github.com/styrainc/regal/cmd.fix({0x14000a17970, 0x1, 0x1}, 0x14000cad680)
	/home/runner/work/regal/regal/cmd/fix.go:273 +0xbc0
github.com/styrainc/regal/cmd.init.2.func3({0x14000a17970?, 0x102bdb11e?, 0x0?})
	/home/runner/work/regal/regal/cmd/fix.go:98 +0x24

here

	versionsMap, err := config.AllRegoVersions(regalDir.Name(), &userConfig)

charlieegan3 added a commit to charlieegan3/regal that referenced this issue Jan 16, 2025
Fixes StyraInc#1341

Signed-off-by: Charlie Egan <charlie@styra.com>
charlieegan3 added a commit to charlieegan3/regal that referenced this issue Jan 16, 2025
Fixes StyraInc#1341

Signed-off-by: Charlie Egan <charlie@styra.com>
@charlieegan3
Copy link
Member

#1343 should be the fix here.

charlieegan3 added a commit to charlieegan3/regal that referenced this issue Jan 16, 2025
Fixes StyraInc#1341

Signed-off-by: Charlie Egan <charlie@styra.com>
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants