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

Chunk index calculation is wrong #3979

Open
czunker opened this issue May 14, 2024 · 1 comment
Open

Chunk index calculation is wrong #3979

czunker opened this issue May 14, 2024 · 1 comment
Assignees
Labels
bug Something isn't working

Comments

@czunker
Copy link
Contributor

czunker commented May 14, 2024

Describe the bug
With the changes introduced with #1346, I think this code is no longer correct:
https://github.com/mondoohq/cnquery/blob/main/llx/code.go#L104-L107

This is how the values look like when called for some sshd.config fields:
image

When the binding/ref is directly passed to Chunk() it results in a index out of range panic.

To Reproduce
Steps to reproduce the behavior:

  1. Go to '...'
  2. Select '....'
  3. Scroll down to '....'
  4. Note the error

Expected behavior
The func should return a chunk and not panic.

@czunker czunker added the bug Something isn't working label May 14, 2024
@jaym
Copy link
Contributor

jaym commented May 17, 2024

its not clear to me why that is considered wrong. It could be that we don't subtract one from it somewhere when accessing the chunk. Or it could be we access the wrong block. Is there some repro steps of a panic you can provide me.

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

2 participants