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

@@ -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;