mirror of
https://github.com/pi-hole/dnsmasq.git
synced 2025-12-19 10:18:25 +00:00
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:
14
src/option.c
14
src/option.c
@@ -1515,10 +1515,16 @@ 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 == '*')
|
||||||
{
|
{
|
||||||
li->next = match_suffix;
|
/* "*" with no suffix is a no-op */
|
||||||
match_suffix = li;
|
if (arg[1] == 0)
|
||||||
/* Have to copy: buffer is overwritten */
|
free(li);
|
||||||
li->suffix = opt_string_alloc(arg+1);
|
else
|
||||||
|
{
|
||||||
|
li->next = match_suffix;
|
||||||
|
match_suffix = li;
|
||||||
|
/* Have to copy: buffer is overwritten */
|
||||||
|
li->suffix = opt_string_alloc(arg+1);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user