Skip to contentSkip to conversation

Fix segfault when no --config argument is given

PATCH In review Arne Schwabe 2 participants 2 messages Jul 22, 2022

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Fix segfault when no --config argument is given

Commit 4df5003 introduced a check against options->config but did not ensure that this varialbe is non-null.

---
 src/openvpn/options.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
src/openvpn/options.c +1 -1
index b9de2e5d0..a68a2991f 100644
@@ -3680,7 +3680,7 @@ options_postprocess_mutate(struct options *o, struct env_set *es)
         o->verify_hash_no_ca = true;
     }
 
-    if (streq(o->config, "stdin") && o->remap_sigusr1 == SIGHUP)
+    if (o->config && streq(o->config, "stdin") && o->remap_sigusr1 == SIGHUP)
     {
         msg(M_USAGE, "Options 'config stdin' and 'remap-usr1 SIGHUP' are "
             "incompatible with each other.");
Signature · 1 line
2.32.1 (Apple Git-133)
Acked-by on v1 1/1
#1 lore raw

Tested with and without --config, AND with "make check"!

Your patch has been applied to the master branch.

commit 6a0fcced7c44ae03a15e2ee28cd1867171c2c988

Author: Arne Schwabe
Date:   Fri Jul 22 15:46:52 2022 +0200
     Fix segfault when no --config argument is given

     Acked-by: Gert Doering <[email protected]...>
     Message-Id: <[email protected]...>
     URL: https://www.mail-archive.com/[email protected]/msg24722.html
     Signed-off-by: Gert Doering <[email protected]...>

--
kind regards,

Gert Doering