Skip to content

🐛 Fix nil pointer dereferences in AWS CloudFront and ECS#6919

Merged
tas50 merged 1 commit intomainfrom
tsmith/fix-aws-nil-deref
Mar 16, 2026
Merged

🐛 Fix nil pointer dereferences in AWS CloudFront and ECS#6919
tas50 merged 1 commit intomainfrom
tsmith/fix-aws-nil-deref

Conversation

@tas50
Copy link
Copy Markdown
Member

@tas50 tas50 commented Mar 16, 2026

Summary

  • CloudFront ListFunctions: Added nil check for FunctionList response. When no CloudFront functions exist, the API returns a nil FunctionList, causing a panic when iterating .Items and checking .NextMarker.
  • ECS DescribeTaskDefinition: Added nil check for TaskDefinition response. The API can return a nil TaskDefinition, causing a panic when iterating .ContainerDefinitions. A similar nil check already exists at line 673 for a different call site.

Test plan

  • Deploy to an AWS account with no CloudFront functions and query aws.cloudfront.functions — should return empty list, not panic
  • Query aws.ecs.tasks where a task definition has been deregistered — should handle gracefully, not panic
  • Verify normal operation (accounts with CloudFront functions and valid task definitions) still works correctly

🤖 Generated with Claude Code

CloudFront ListFunctions can return nil FunctionList when no functions
exist, causing a panic. ECS DescribeTaskDefinition can return nil
TaskDefinition, also causing a panic on ContainerDefinitions access.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Copy link
Copy Markdown

@mondoo-code-review mondoo-code-review bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixes crashes when AWS CloudFront or ECS APIs return nil response objects.

@tas50 tas50 changed the title Fix nil pointer dereferences in AWS CloudFront and ECS 🐛 Fix nil pointer dereferences in AWS CloudFront and ECS Mar 16, 2026
@tas50 tas50 merged commit 04a4fcc into main Mar 16, 2026
21 checks passed
@tas50 tas50 deleted the tsmith/fix-aws-nil-deref branch March 16, 2026 05:02
@github-actions github-actions bot locked and limited conversation to collaborators Mar 16, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant