4 Commits
Author SHA1 Message Date
dualfroz 650669002f fix(strutil): clamp Substr stop index to avoid out-of-range panic
Substr panicked with a slice-bounds error when a negative length trimmed
more runes than remained after pos, because stopIdx (strLn + length) could
fall before pos. Clamp stopIdx to pos so an over-long negative trim returns
an empty string, matching the existing pos >= strLn guard.
2026-09-04 09:10:31 +02:00
upstream 1ffc0f390b Upstream gookit/goutil state of the touched files before 71dcf88743 2026-09-04 09:10:31 +02:00
dualfroz fd69f1aadd fix(strutil): clamp Substr stop index to avoid out-of-range panic
Substr panicked with a slice-bounds error when a negative length trimmed
more runes than remained after pos, because stopIdx (strLn + length) could
fall before pos. Clamp stopIdx to pos so an over-long negative trim returns
an empty string, matching the existing pos >= strLn guard.
2026-09-06 00:44:31 +02:00
upstream d489e58561 Upstream gookit/goutil state of the touched files before 54004efbfe 2026-09-04 09:10:31 +02:00