]> git.ipfire.org Git - ipfire-2.x.git/blob - src/patches/dnsmasq/015-Fix_crash_at_start_up_with_conf-dir.patch
bird: New package
[ipfire-2.x.git] / src / patches / dnsmasq / 015-Fix_crash_at_start_up_with_conf-dir.patch
1 From 0007ee90646a5a78a96ee729932e89d31c69513a Mon Sep 17 00:00:00 2001
2 From: Simon Kelley <simon@thekelleys.org.uk>
3 Date: Sat, 21 Nov 2015 21:47:41 +0000
4 Subject: [PATCH] Fix crash at start up with conf-dir=/path,*
5
6 Thanks to Brian Carpenter and American Fuzzy Lop for finding the bug.
7 ---
8 src/option.c | 14 ++++++++++----
9 1 file changed, 10 insertions(+), 4 deletions(-)
10
11 diff --git a/src/option.c b/src/option.c
12 index 746cd11..71beb98 100644
13 --- a/src/option.c
14 +++ b/src/option.c
15 @@ -1515,10 +1515,16 @@ static int one_opt(int option, char *arg, char *errstr, char *gen_err, int comma
16 li = opt_malloc(sizeof(struct list));
17 if (*arg == '*')
18 {
19 - li->next = match_suffix;
20 - match_suffix = li;
21 - /* Have to copy: buffer is overwritten */
22 - li->suffix = opt_string_alloc(arg+1);
23 + /* "*" with no suffix is a no-op */
24 + if (arg[1] == 0)
25 + free(li);
26 + else
27 + {
28 + li->next = match_suffix;
29 + match_suffix = li;
30 + /* Have to copy: buffer is overwritten */
31 + li->suffix = opt_string_alloc(arg+1);
32 + }
33 }
34 else
35 {
36 --
37 1.7.10.4
38