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

.Label() and .Child() for types panic on some map types #3936

Open
czunker opened this issue May 7, 2024 · 0 comments
Open

.Label() and .Child() for types panic on some map types #3936

czunker opened this issue May 7, 2024 · 0 comments
Labels
bug Something isn't working

Comments

@czunker
Copy link
Contributor

czunker commented May 7, 2024

Describe the bug
We experienced a panic in the backend, when trying to call .Label() or .Child() on a map.

The panics happened here:
https://github.com/mondoohq/cnquery/blob/main/types/types.go#L271
and
https://github.com/mondoohq/cnquery/blob/main/types/types.go#L224

The resource which triggered this was most likely logindefs.params.
Strange is, the resource is defined as map[string]string:

params(content) map[string]string

But created as map[string]interface:
res := make(map[string]interface{})

To Reproduce
Steps to reproduce the behavior:

  1. I'm not sure how to replicate this with cnquery directly.

Expected behavior
No panic.

Desktop (please complete the following information):

  • cnquery v11.2.0 and os provider 11.1.0
@czunker czunker added the bug Something isn't working label May 7, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant