mondoohq / cnquery

open source, cloud-native, graph-based asset inventory

Home Page:https://cnquery.io

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

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

czunker opened this issue · comments

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