mirror of
https://github.com/grafana/loki.git
synced 2026-03-13 09:33:58 +08:00
The intent here is to remove an extension of a file, namely .gz. This is currently implemented with a strings.Trim, which will remove ALL occurrences of ., g, and z from the start and end of the string. For example, that'd break egg.gz as it'd return just e. This commit restores the intent of removing only the .gz suffix. I haven't been able to find an exploitable path for this, luckily, so I'm only aiming to restore the intent that seems to be originally held here. (Detected with help of CodeQL)