Skip to content

🐛 Fix nil panic in GCP IAM service account init#6900

Merged
tas50 merged 1 commit intomainfrom
fix/gcp-iam-nil-panic
Mar 13, 2026
Merged

🐛 Fix nil panic in GCP IAM service account init#6900
tas50 merged 1 commit intomainfrom
fix/gcp-iam-nil-panic

Conversation

@tas50
Copy link
Copy Markdown
Member

@tas50 tas50 commented Mar 13, 2026

Summary

  • Add nil checks for projectId and email args in initGcpProjectIamServiceServiceAccount before accessing their values
  • Prevents nil pointer dereference when these args are not provided
  • Follows the same guard pattern used elsewhere in the codebase (e.g., the len(args) > 2 check above)

Test plan

  • Verify GCP IAM service account queries still work: mql run gcp -c "gcp.project.iamService.serviceAccounts { email }"
  • Confirm no panic when service account is referenced without projectId/email args

🤖 Generated with Claude Code

Add nil checks for projectId and email args before accessing their
values, preventing a nil pointer dereference when these args are missing.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@tas50 tas50 changed the title Fix nil panic in GCP IAM service account init 🐛 Fix nil panic in GCP IAM service account init Mar 13, 2026
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 a nil pointer panic when GCP IAM service account init is called without required arguments.

@github-actions
Copy link
Copy Markdown
Contributor

Test Results

5 450 tests  ±0   5 446 ✅ ±0   1m 58s ⏱️ -38s
  412 suites ±0       4 💤 ±0 
   31 files   ±0       0 ❌ ±0 

Results for commit adc96c9. ± Comparison against base commit 8fa834c.

@tas50 tas50 merged commit e889b51 into main Mar 13, 2026
22 checks passed
@tas50 tas50 deleted the fix/gcp-iam-nil-panic branch March 13, 2026 19:37
@github-actions github-actions bot locked and limited conversation to collaborators Mar 13, 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