Skip to content
New issue

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

Plik segfaults when MaxTTL is set to -1 and DefaultTTL is a valid int #342

Closed
rhass opened this issue Nov 18, 2020 · 0 comments
Closed

Plik segfaults when MaxTTL is set to -1 and DefaultTTL is a valid int #342

rhass opened this issue Nov 18, 2020 · 0 comments
Assignees
Labels
Milestone

Comments

@rhass
Copy link

rhass commented Nov 18, 2020

I upgraded to v1.3.1 and my previous config values resulted in the server crashing while parsing the config file.
The values which angered it were:

DefaultTTL          = 604800        # 7 days
MaxTTL              = -1            # -1 => No limit

The resulting error was as follows:

Unable to read config file : DefaultTTL should not be more than MaxTTL
panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x0 pc=0x859506]

goroutine 1 [running]:
github.com/root-gg/plik/server/common.(*Configuration).NewLogger(0x0, 0xc000377410)
	/go/src/github.com/root-gg/plik/server/common/config.go:173 +0x26
github.com/root-gg/plik/server/server.(*PlikServer).start(0xc000366240, 0xc00033fcb0, 0x410158)
	/go/src/github.com/root-gg/plik/server/server/server.go:82 +0x65
github.com/root-gg/plik/server/server.(*PlikServer).Start(0xc000366240, 0x0, 0x0)
	/go/src/github.com/root-gg/plik/server/server/server.go:78 +0xde
github.com/root-gg/plik/server/cmd.startPlikServer(0x13472e0, 0xc0002311e0, 0x0, 0x2)
	/go/src/github.com/root-gg/plik/server/cmd/root.go:145 +0x9d
github.com/spf13/cobra.(*Command).execute(0x13472e0, 0xc000032190, 0x2, 0x2, 0x13472e0, 0xc000032190)
	/go/pkg/mod/github.com/spf13/[email protected]/command.go:835 +0x2c2
github.com/spf13/cobra.(*Command).ExecuteC(0x13472e0, 0x44764a, 0x135da20, 0xc000000180)
	/go/pkg/mod/github.com/spf13/[email protected]/command.go:919 +0x30b
github.com/spf13/cobra.(*Command).Execute(...)
	/go/pkg/mod/github.com/spf13/[email protected]/command.go:869
github.com/root-gg/plik/server/cmd.Execute()
	/go/src/github.com/root-gg/plik/server/cmd/root.go:36 +0x31
main.main()
	/go/src/github.com/root-gg/plik/server/main.go:6 +0x25
@camathieu camathieu added the bug label Nov 18, 2020
@camathieu camathieu added this to the 1.3.2 milestone Nov 18, 2020
@camathieu camathieu self-assigned this Nov 18, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants