fix: add NULL-checks and input validation in CLI argument parsing (#152) #153
Reference in New Issue
Block a user
Delete Branch "fix/null-checks-cli"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Fixes #152
Adds NULL-checks and proper input validation for all argument parsing paths in client_cli.c:
All 22 unit tests pass.
=== PR REVIEW SUMMARY ===
Branch: fix/null-checks-cli (PR #153)
Files: 1 (src/client/client_cli.c)
Issues: 8 (0 critical, 2 warning, 6 style)
=== VERDICT ===
[PASS] All 22 tests pass, build clean. 2 warnings should be addressed.
=== ISSUES ===
[1] src/client/client_cli.c:312 — WARNING (memory) --cert str_dup not NULL-checked
[2] src/client/client_cli.c:315 — WARNING (memory) --key str_dup not NULL-checked
[3] src/client/client_cli.c:318 — STYLE (memory) --ca str_dup not NULL-checked
[4] src/client/client_cli.c:320 — STYLE (validation) --timeout uses atoi()
[5] src/client/client_cli.c:327 — STYLE (validation) --contimeout uses atoi()
[6] src/client/client_cli.c:348 — STYLE (validation) --max-depth uses atoi()
[7] src/client/client_cli.c:364 — STYLE (validation) --queue-size uses atoi()
[8] src/client/client_cli.c:215,221,231,305 — STYLE (validation) strtoull/strtol without errno/endptr checks
Pull request closed