Fix crash at start up with conf-dir=/path,*

Thanks to Brian Carpenter and American Fuzzy Lop for finding the bug.
This commit is contained in:
Simon Kelley
2015-11-21 21:47:41 +00:00
parent 67ab3285b5
commit 0007ee9064

View File

@@ -1514,12 +1514,18 @@ static int one_opt(int option, char *arg, char *errstr, char *gen_err, int comma
{
li = opt_malloc(sizeof(struct list));
if (*arg == '*')
{
/* "*" with no suffix is a no-op */
if (arg[1] == 0)
free(li);
else
{
li->next = match_suffix;
match_suffix = li;
/* Have to copy: buffer is overwritten */
li->suffix = opt_string_alloc(arg+1);
}
}
else
{
li->next = ignore_suffix;