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
ParseRangeString may return NIL on errors, but in EvaluateThreshold this is not checked will lead to a panic
runtime error: invalid memory address or nil pointer dereference goroutine 36 [running]: runtime/debug.Stack() C:/Users/user/go-sdk/go1.21.3/src/runtime/debug/stack.go:24 +0x6b github.com/atc0005/go-nagios.(*Plugin).ReturnCheckResults(0xc0000c40e0) C:/local/progs/go-proj/src/check_hm/vendor/github.com/atc0005/go-nagios/nagios.go:283 +0x305 panic({0x1af6600?, 0x216afd0?}) C:/Users/user/go-sdk/go1.21.3/src/runtime/panic.go:920 +0x290 github.com/atc0005/go-nagios.(*Plugin).EvaluateThreshold(0xc0000c40e0, {0xc0001f16c0, 0x1, 0x1}) C:/local/progs/go-proj/src/check_hm/vendor/github.com/atc0005/go-nagios/range.go:153 +0xed First
runtime error: invalid memory address or nil pointer dereference goroutine 36 [running]: runtime/debug.Stack() C:/Users/user/go-sdk/go1.21.3/src/runtime/debug/stack.go:24 +0x6b github.com/atc0005/go-nagios.(*Plugin).ReturnCheckResults(0xc0000c40e0) C:/local/progs/go-proj/src/check_hm/vendor/github.com/atc0005/go-nagios/nagios.go:283 +0x305 panic({0x1af6600?, 0x216afd0?}) C:/Users/user/go-sdk/go1.21.3/src/runtime/panic.go:920 +0x290 github.com/atc0005/go-nagios.(*Plugin).EvaluateThreshold(0xc0000c40e0, {0xc0001f16c0, 0x1, 0x1}) C:/local/progs/go-proj/src/check_hm/vendor/github.com/atc0005/go-nagios/range.go:153 +0xed
go-nagios/range.go
Lines 151 to 153 in 7a6e921
second:
Lines 160 to 164 in 7a6e921
may panic here if warningThreshold object is nil
The text was updated successfully, but these errors were encountered:
@Tommi2Day,
Thank you for this report. I appreciate the specifics you have provided.
@infraweavers,
Any interest in taking a look at this? If you use a modified version of the code contributed in GH-178 is it publicly available?
I figured it was best to touch base with you to see if this was already resolved in a private branch before digging into it.
Thanks.
Sorry, something went wrong.
validate range return value in EvaluateThreshold
c3aa51a
fixes atc0005/go-nagios/atc0005#233
4c67d71
fixes atc0005#233
eefbcd5
atc0005
Successfully merging a pull request may close this issue.
ParseRangeString may return NIL on errors, but in EvaluateThreshold this is not checked will lead to a panic
runtime error: invalid memory address or nil pointer dereference goroutine 36 [running]: runtime/debug.Stack() C:/Users/user/go-sdk/go1.21.3/src/runtime/debug/stack.go:24 +0x6b github.com/atc0005/go-nagios.(*Plugin).ReturnCheckResults(0xc0000c40e0) C:/local/progs/go-proj/src/check_hm/vendor/github.com/atc0005/go-nagios/nagios.go:283 +0x305 panic({0x1af6600?, 0x216afd0?}) C:/Users/user/go-sdk/go1.21.3/src/runtime/panic.go:920 +0x290 github.com/atc0005/go-nagios.(*Plugin).EvaluateThreshold(0xc0000c40e0, {0xc0001f16c0, 0x1, 0x1}) C:/local/progs/go-proj/src/check_hm/vendor/github.com/atc0005/go-nagios/range.go:153 +0xed
First
go-nagios/range.go
Lines 151 to 153 in 7a6e921
may panic here if CritcalThreshold object is nil
second:
go-nagios/range.go
Lines 160 to 164 in 7a6e921
may panic here if warningThreshold object is nil
The text was updated successfully, but these errors were encountered: