Fix NULL-dereference crash with some command line options (#1567)

It is possible to crash freshclam and probably other programs like this:
```
freshclam --datadir /any/path
```

CLAM-2860
This commit is contained in:
Val S. 2025-09-15 18:16:09 -04:00 committed by GitHub
parent bae86fd272
commit 1d158c13d4
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -1253,6 +1253,7 @@ struct optstruct *optparse(const char *cfgfile, int argc, char **argv, int verbo
}
}
if (NULL != arg) {
/* Find and remove inline comments. */
numarg = -1;
inlinecomment = strchr(arg, '#');
@ -1264,6 +1265,7 @@ struct optstruct *optparse(const char *cfgfile, int argc, char **argv, int verbo
*(trim_comment--) = '\0';
}
}
}
switch (optentry->argtype) {
case CLOPT_TYPE_STRING: