Commit 668fb3fd547e9b5a789f21436a647c4bbb20d4f4
Fixup UB fix in cmds_handler.c:parse_cpmv_flags()
Didn't dereference the pointer and ended up checking it for NULL, which
is never the case...
Follow-up to caa492aa8dffec6:
Fix UB in cmds_handler.c:parse_cpmv_flags()
Avoid incrementing NULL *argv by zero when there are no
parameters.
Author: xaizek
Author date (UTC): 2026-03-12 10:16
Committer name: xaizek
Committer date (UTC): 2026-03-12 10:21
Parent(s): 8df77c0139ea22692971e47f93b39fa365049ead
Signing key: 99DC5E4DB05F6BE2
Tree: 2ee69aad97c6b6f8dcb1c1116e52bdaf112b2045
| File src/cmd_handlers.c changed (mode: 100644) (index 753eeca77..aa0a3ff42) |
| ... |
... |
parse_cpmv_flags(int *argc, char ***argv) |
| 4422 |
4422 |
{ |
{ |
| 4423 |
4423 |
int flags = 0; |
int flags = 0; |
| 4424 |
4424 |
|
|
| 4425 |
|
if(argc == 0) |
|
|
4425 |
|
if(*argc == 0) |
| 4426 |
4426 |
{ |
{ |
| 4427 |
4427 |
/* To avoid incrementing NULL *argv by zero at the bottom. */ |
/* To avoid incrementing NULL *argv by zero at the bottom. */ |
| 4428 |
4428 |
return flags; |
return flags; |