Adds NULL-checks and proper input validation for all argument parsing paths in client_cli.c:
Check all str_dup() return values for NULL
Replace atoi() with strtol() + endptr validation for port numbers
Add errno/endptr validation for strtoull calls (--max-size, --min-size)
Validate positional directory arguments for allocation failure
All 22 unit tests pass.
Fixes #152
Adds NULL-checks and proper input validation for all argument parsing paths in client_cli.c:
- Check all str_dup() return values for NULL
- Replace atoi() with strtol() + endptr validation for port numbers
- Add errno/endptr validation for strtoull calls (--max-size, --min-size)
- Validate positional directory arguments for allocation failure
All 22 unit tests pass.
- Add NULL-checks for all str_dup() calls in argument parsing
- Replace atoi with strtol + endptr validation for port numbers
- Add errno/endptr validation for strtoull calls (--max-size, --min-size)
- Check str_dup result for exclude/include patterns, server-host, backup-dir
- Validate positional directory arguments for allocation failure
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
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