-
Notifications
You must be signed in to change notification settings - Fork 80
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
Add: gvm_json_obj_check_str #882
Conversation
Dependency Review✅ No vulnerabilities or license issues or OpenSSF Scorecard issues found.Snapshot WarningsEnsure that dependencies are being submitted on PR branches and consider enabling retry-on-snapshot-warnings. See the documentation for more information and troubleshooting advice. OpenSSF Scorecard
Scanned Files |
🔍 Vulnerabilities of
|
digest | sha256:8525ebe631a2e240c61cad978c9fde338c252d7e0a7abfb2395647089e7a1a50 |
vulnerabilities | |
size | 66 MB |
packages | 204 |
📦 Base Image debian:testing-20250203-slim
also known as |
|
digest | sha256:7b210de05a39d3a5c4534343349eb918a99af2ac570953ae2505b6116f6403a0 |
vulnerabilities |
Description
Description
Description
Description
Description
| ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Description
Description
| ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Description
Description
| ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Description
| ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Description
Description
Description
Description
Description
Description
Description
| ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Description
Description
Description
Description
Description | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Description
Description
Description
Description
| ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Description
Description
Description
Description
| ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Description
Description
Description
| ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Description
Description
| ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Description
Description
| ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Description
Description
| ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Description
| ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Description
| ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Description
| ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Description
|
ddf5d95
to
7750360
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me!
It seems we don't have tests for vtparser.c yet. We really should ensure not adding any new code without unit tests.
I'll take a look next week. |
That would be really great! thanks is lot in advance! |
What
Add function
gvm_json_obj_check_str
and use it invtparser.c
andopenvasd.c
.This is a variation on
gvm_json_obj_str
that allows you to retrieve the string field and at the same time get a return value that indicates if the field existed.Why
Neater than using the repeated cJSON snippets.
As with the similar PRs, this has the nice side effect of removing assignments from
if
conditions.Note that the function returns 0 if the field exists, and an error value otherwise. Currently the error is always 1, but this style allows us to add more detail to the error value in future, eg if someone wants to know if the field existed but was the wrong type it could return 2.
References
Similar to /pull/881 for ints.
Follows
gvm_json_obj_str
from /pull/877.Checklist