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

[bug] Missing null check for certifyLegal with blobstore #2192

Closed
robert-cronin opened this issue Oct 11, 2024 · 1 comment · Fixed by #2193
Closed

[bug] Missing null check for certifyLegal with blobstore #2192

robert-cronin opened this issue Oct 11, 2024 · 1 comment · Fixed by #2193
Labels
bug Something isn't working

Comments

@robert-cronin
Copy link
Contributor

Describe the bug
A clear and concise description of what the bug is.
This bug is just a missing null check in the certifyLegal keyvalue code:

out = append(out, legal)

Relevant disussion: #2168 (comment)

To Reproduce
Steps to reproduce the behavior:

  1. Start GUAC up as usual with the blobstore backend
  2. Ingest guac-main-data with guacone collect
  3. Run the following query in the graphql IDE:
query CertifyLegalQ1 {
    CertifyLegal(certifyLegalSpec: {subject: {package: {name: "log4j-core"} } }) {
        id
    }
}

Expected behavior
Return either empty for no result or that found result, i.e.:
image

Actual
The actual query will fail for each element because there is no null check on the legalIfMatch result, e.g. for the above query

    {
      "message": "the requested element is null which the schema does not allow",
      "path": [
        "CertifyLegal",
        21
      ]
    },

GUAC version
Are you using a released version of GUAC or one build from a commit in the
repository?
v0.9.1

Additional context
N/A

@robert-cronin robert-cronin added the bug Something isn't working label Oct 11, 2024
@robert-cronin
Copy link
Contributor Author

I'll add a fix for this in another PR

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

Successfully merging a pull request may close this issue.

1 participant