Skip to content

Commit 115de8e

Browse files
authored
fix: possible nil deref in admin_info (#3500)
1 parent 27cb17d commit 115de8e

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

api/admin_info.go

+5-4
Original file line numberDiff line numberDiff line change
@@ -1121,12 +1121,13 @@ LabelsWaitLoop:
11211121
if inStep != nil && *inStep > 0 {
11221122
step = *inStep
11231123
}
1124-
if step > 0 {
1125-
extraParamters = fmt.Sprintf("%s&step=%d", extraParamters, step)
1126-
}
11271124

11281125
if inStart != nil && inEnd != nil {
1129-
extraParamters = fmt.Sprintf("&start=%d&end=%d&step=%d", *inStart, *inEnd, *inStep)
1126+
extraParamters = fmt.Sprintf("&start=%d&end=%d", *inStart, *inEnd)
1127+
}
1128+
1129+
if step > 0 {
1130+
extraParamters = fmt.Sprintf("%s&step=%d", extraParamters, step)
11301131
}
11311132

11321133
// replace the `$__rate_interval` global for step with unit (s for seconds)

0 commit comments

Comments
 (0)