Fix crash parsing a --synth-domain with no prefix.

Problem introduced in 2.79/6b2b564ac34cb3c862f168e6b1457f9f0b9ca69c
This commit is contained in:
Simon Kelley
2018-07-30 14:55:39 +01:00
parent c16d966ad3
commit dd33e98da0
2 changed files with 8 additions and 3 deletions

View File

@@ -42,6 +42,9 @@ version 2.80
(server, local, address, rebind-domain-ok, ipset, alias).
Thanks to Eugene Lozovoy for spotting the problem.
Fix crash on startup with a --synth-domain which has no prefix.
Introduced in 2.79. Thanks to Andreas Engel for the bug report.
version 2.79
Fix parsing of CNAME arguments, which are confused by extra spaces.

View File

@@ -2232,7 +2232,9 @@ static int one_opt(int option, char *arg, char *errstr, char *gen_err, int comma
char *star;
new->next = daemon->synth_domains;
daemon->synth_domains = new;
if ((star = strrchr(new->prefix, '*')) && *(star+1) == 0)
if (new->prefix &&
(star = strrchr(new->prefix, '*'))
&& *(star+1) == 0)
{
*star = 0;
new->indexed = 1;