Skip to content

Commit 39bf246

Browse files
tas50claude
andcommitted
🐛 Add bounds check to parseLogGroupArn for malformed ARNs
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent 18957d8 commit 39bf246

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

providers/aws/resources/aws_cloudwatch.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -730,6 +730,9 @@ func (a *mqlAwsCloudwatchLoggroup) id() (string, error) {
730730
// Group names may contain colons, so we rejoin parts 6..n-1 (stripping trailing "*").
731731
func parseLogGroupArn(arnValue string) (region string, groupName string) {
732732
parts := strings.Split(arnValue, ":")
733+
if len(parts) < 8 {
734+
return "", ""
735+
}
733736
region = parts[3]
734737
// Rejoin parts 6 through second-to-last to handle names with colons
735738
groupName = strings.Join(parts[6:len(parts)-1], ":")

0 commit comments

Comments
 (0)