Commit caa492aa8dffec6109f73eed0830b8d95b03c506
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-04 19:10
Committer name: xaizek
Committer date (UTC): 2026-03-04 19:10
Parent(s): 2410222e35e94759dbe53439d20a245fc5a32a7f
Signing key: 99DC5E4DB05F6BE2
Tree: 76a1cc2d9c956c413e5cb2ec1a63e52f335a7cc6
| File src/cmd_handlers.c changed (mode: 100644) (index 707b86aad..753eeca77) |
| ... |
... |
parse_cpmv_flags(int *argc, char ***argv) |
| 4422 |
4422 |
{ |
{ |
| 4423 |
4423 |
int flags = 0; |
int flags = 0; |
| 4424 |
4424 |
|
|
|
4425 |
|
if(argc == 0) |
|
4426 |
|
{ |
|
4427 |
|
/* To avoid incrementing NULL *argv by zero at the bottom. */ |
|
4428 |
|
return flags; |
|
4429 |
|
} |
|
4430 |
|
|
| 4425 |
4431 |
int i; |
int i; |
| 4426 |
4432 |
for(i = 0; i < *argc; ++i) |
for(i = 0; i < *argc; ++i) |
| 4427 |
4433 |
{ |
{ |