From 115de8ee25393ca2e47bdb373ee076e4eab2f2d3 Mon Sep 17 00:00:00 2001 From: Burkov Egor Date: Tue, 11 Feb 2025 05:04:21 +0300 Subject: [PATCH] fix: possible nil deref in admin_info (#3500) --- api/admin_info.go | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/api/admin_info.go b/api/admin_info.go index 715ccb70d..6ad3ac339 100644 --- a/api/admin_info.go +++ b/api/admin_info.go @@ -1121,12 +1121,13 @@ LabelsWaitLoop: if inStep != nil && *inStep > 0 { step = *inStep } - if step > 0 { - extraParamters = fmt.Sprintf("%s&step=%d", extraParamters, step) - } if inStart != nil && inEnd != nil { - extraParamters = fmt.Sprintf("&start=%d&end=%d&step=%d", *inStart, *inEnd, *inStep) + extraParamters = fmt.Sprintf("&start=%d&end=%d", *inStart, *inEnd) + } + + if step > 0 { + extraParamters = fmt.Sprintf("%s&step=%d", extraParamters, step) } // replace the `$__rate_interval` global for step with unit (s for seconds)