Commit 0007ee90 authored by Simon Kelley's avatar Simon Kelley

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

Thanks to Brian Carpenter and American Fuzzy Lop for finding the bug.
parent 67ab3285
...@@ -1514,12 +1514,18 @@ static int one_opt(int option, char *arg, char *errstr, char *gen_err, int comma ...@@ -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)); li = opt_malloc(sizeof(struct list));
if (*arg == '*') if (*arg == '*')
{
/* "*" with no suffix is a no-op */
if (arg[1] == 0)
free(li);
else
{ {
li->next = match_suffix; li->next = match_suffix;
match_suffix = li; match_suffix = li;
/* Have to copy: buffer is overwritten */ /* Have to copy: buffer is overwritten */
li->suffix = opt_string_alloc(arg+1); li->suffix = opt_string_alloc(arg+1);
} }
}
else else
{ {
li->next = ignore_suffix; li->next = ignore_suffix;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment