Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

🐛 fix crash on empty array.flat with missing type info #3106

Merged
merged 1 commit into from
Jan 24, 2024

Conversation

arlimus
Copy link
Member

@arlimus arlimus commented Jan 24, 2024

This can unfortunately still happen, where the type info is missing and we essentially get the array indication in the type field, but nothing else. The subsequent for loop then crashes it.

Add testing for this use-case and fix the crash by forcing the any-type into it.

This can unfortunately still happen, where the type info is missing and
we essentially get the array indication in the type field, but nothing
else. The subsequent for loop then crashes it.

Add testing for this use-case and fix the crash by forcing the any-type
into it.

Signed-off-by: Dominik Richter <[email protected]>
Copy link
Contributor

Test Results

744 tests  +2   744 ✅ +2   13s ⏱️ -1s
 83 suites ±0     0 💤 ±0 
  1 files   ±0     0 ❌ ±0 

Results for commit 5252e99. ± Comparison against base commit 89fb1a1.

This pull request removes 3 and adds 5 tests. Note that renamed tests count towards both.
go.mondoo.com/cnquery/v10/llx ‑ TestSuccess/2024-01-21_23:21:04.710718129_+0000_UTC_m=+0.000878042
go.mondoo.com/cnquery/v10/llx ‑ TestTruthy/2024-01-21_23:21:04.710718129_+0000_UTC_m=+0.000878042
go.mondoo.com/cnquery/v10/llx ‑ TestTruthy/2024-01-21_23:21:04.710718129_+0000_UTC_m=+0.000878042#01
go.mondoo.com/cnquery/v10/llx ‑ TestArrayFlat
go.mondoo.com/cnquery/v10/llx ‑ TestArrayFlat/empty_array_with_missing_type_info
go.mondoo.com/cnquery/v10/llx ‑ TestSuccess/2024-01-24_06:33:44.053570502_+0000_UTC_m=+0.001121971
go.mondoo.com/cnquery/v10/llx ‑ TestTruthy/2024-01-24_06:33:44.053570502_+0000_UTC_m=+0.001121971
go.mondoo.com/cnquery/v10/llx ‑ TestTruthy/2024-01-24_06:33:44.053570502_+0000_UTC_m=+0.001121971#01

@vjeffrey vjeffrey merged commit 9a4150a into main Jan 24, 2024
12 checks passed
@vjeffrey vjeffrey deleted the dom/array-flat branch January 24, 2024 07:14
@github-actions github-actions bot locked and limited conversation to collaborators Jan 24, 2024
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.

2 participants