From dd33e98da09c487a58b6cb6693b8628c0b234a3b Mon Sep 17 00:00:00 2001 From: Simon Kelley Date: Mon, 30 Jul 2018 14:55:39 +0100 Subject: [PATCH] Fix crash parsing a --synth-domain with no prefix. Problem introduced in 2.79/6b2b564ac34cb3c862f168e6b1457f9f0b9ca69c --- CHANGELOG | 7 +++++-- src/option.c | 4 +++- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/CHANGELOG b/CHANGELOG index 3fe3e77..792ef3d 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -41,8 +41,11 @@ version 2.80 Fix missing fatal errors with some malformed options (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. Thanks to Diego Aguirre for spotting the bug. diff --git a/src/option.c b/src/option.c index 9f1b84f..c203826 100644 --- a/src/option.c +++ b/src/option.c @@ -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;