From: "cron2 (Code Review)" Date: Wed, 28 Jan 2026 13:19:17 +0000 In-Reply-To: References: Reply-To: gert@...1296..., arne-openvpn@...1227..., heiko@...515..., openvpn-devel@lists.sourceforge.net Message-ID: <56ce041b74557f8e7a5838cc0916fc4e4e0f1872-HTML@...2715...> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Disposition: inline Content-Type: multipart/alternative; boundary="aScycTIkLoM="; charset=UTF-8 Subject: [Openvpn-devel] [XS] Change in openvpn[master]: Prevent NULL pointer dereference with --dns-updown List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: d12fk Cc: plaisthos , openvpn-devel --aScycTIkLoM= Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable cron2 has submitted this change. ( http://gerrit.openvpn.net/c/openvpn/+/14= 98?usp=3Demail ) Change subject: Prevent NULL pointer dereference with --dns-updown ...................................................................... Prevent NULL pointer dereference with --dns-updown If the dns-updown option appears in the config twice, there is a chance of a NULL pointer dereference when comparing the script path to the default script path. This happens when a custom script is set, after the dns-updown script was disabled first. In that case the script path is NULL, which leads to the deref during a strcmp(3). Reported-by: Change-Id: Id530d890ba01cffb74d3dc04ad10b153f7bea1d4 Signed-off-by: Heiko Hund Acked-by: Arne Schwabe Gerrit URL: https://gerrit.openvpn.net/c/openvpn/+/1498 Message-Id: <20260128110443.24410-1-gert@...1296...> URL: https://www.mail-archive.com/openvpn-devel@lists.sourceforge.net/msg35= 479.html Signed-off-by: Gert Doering --- M src/openvpn/options.c 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/openvpn/options.c b/src/openvpn/options.c index 85669e0..2bca647 100644 --- a/src/openvpn/options.c +++ b/src/openvpn/options.c @@ -7890,7 +7890,7 @@ } else { - if (streq(dns->updown, DEFAULT_DNS_UPDOWN)) + if (dns->updown && streq(dns->updown, DEFAULT_DNS_UPDOWN)) { /* Unset the default command to prevent warnings */ dns->updown =3D NULL; -- To view, visit http://gerrit.openvpn.net/c/openvpn/+/1498?usp=3Demail To unsubscribe, or for help writing mail filters, visit http://gerrit.openv= pn.net/settings?usp=3Demail Gerrit-MessageType: merged Gerrit-Project: openvpn Gerrit-Branch: master Gerrit-Change-Id: Id530d890ba01cffb74d3dc04ad10b153f7bea1d4 Gerrit-Change-Number: 1498 Gerrit-PatchSet: 2 Gerrit-Owner: d12fk Gerrit-Reviewer: plaisthos Gerrit-CC: openvpn-devel --aScycTIkLoM= Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable

cron2 sub= mitted this change.

View Change

Prevent NULL pointer dereference with --dns-updo=
wn

If the dns-updown option appears in the config twice, there is a = chance
of a NULL pointer dereference when comparing the script path to t= he
default script path. This happens when a custom script is set, after = the
dns-updown script was disabled first. In that case the script path i= s
NULL, which leads to the deref during a strcmp(3).

Reported-by:= <aarnav@...2953...>
Change-Id: Id530d890ba01cffb74d3dc04ad10b153f= 7bea1d4
Signed-off-by: Heiko Hund <heiko@...2662...>
Acked-by: = Arne Schwabe <arne-openvpn@...1227...>
Gerrit URL: https://gerrit.= openvpn.net/c/openvpn/+/1498
Message-Id: <20260128110443.24410-1-gert= @...1296...>
URL: https://www.mail-archive.com/openvpn-devel@...1466...= urceforge.net/msg35479.html
Signed-off-by: Gert Doering <gert@...1726...= ...>
---
M src/openvpn/options.c
1 file changed, 1 insertion(+)= , 1 deletion(-)

diff --git a/src/openvpn/options.c b/src/openvpn/options.c
index 85669e0..2bca647 100644
--- a/src/openvpn/options.= c
+++ b/src/openvpn/options.c
@@ -7890,7 +7= 890,7 @@
}
else {
- = if (streq(dns->updown, DEFAULT_DNS_UPDOWN))
+ if (dns->updown &&= ; streq(dns->updown, DEFAULT_DNS_UPDOWN))
{=
/* Unset the default command to prevent w= arnings */
dns->updown =3D NULL;=

To view, visit change 1498. To unsubscribe, or fo= r help writing mail filters, visit settings.

Gerrit-MessageType: merged
Gerrit-Project: openvpn
Gerrit-Branch: master
Gerrit-Change-Id: Id530d890ba01cffb74d3dc04ad1= 0b153f7bea1d4
Gerrit-Change-Number: 1498
Gerrit-PatchSet: 2
Gerrit-Owner: d12fk <heiko@...515...>
Gerrit-Reviewer: plaisthos <arne-openvpn@...1186...= .1227...>
Gerrit-CC: openvpn-devel <openvpn-devel@...1484...= ts.sourceforge.net>
= --aScycTIkLoM=--