mirror of
https://github.com/Cisco-Talos/clamav.git
synced 2025-10-19 18:33:16 +00:00
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:
parent
bae86fd272
commit
1d158c13d4
1 changed files with 11 additions and 9 deletions
|
@ -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:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue