From: "d12fk (Code Review)" Date: Tue, 27 Jan 2026 23:30:53 +0000 References: Reply-To: heiko@...515..., arne-openvpn@...1227..., openvpn-devel@lists.sourceforge.net Message-ID: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Disposition: inline Content-Type: multipart/alternative; boundary="cGGdpgfRHvI="; 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: plaisthos Cc: openvpn-devel --cGGdpgfRHvI= Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Attention is currently required from: plaisthos. Hello plaisthos, I'd like you to do a code review. Please visit http://gerrit.openvpn.net/c/openvpn/+/1498?usp=3Demail to review the following change. 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 --- M src/openvpn/options.c 1 file changed, 1 insertion(+), 1 deletion(-) git pull ssh://gerrit.openvpn.net:29418/openvpn refs/changes/98/1498/1 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: newchange Gerrit-Project: openvpn Gerrit-Branch: master Gerrit-Change-Id: Id530d890ba01cffb74d3dc04ad10b153f7bea1d4 Gerrit-Change-Number: 1498 Gerrit-PatchSet: 1 Gerrit-Owner: d12fk Gerrit-Reviewer: plaisthos Gerrit-CC: openvpn-devel Gerrit-Attention: plaisthos --cGGdpgfRHvI= Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable

Attention is cur= rently required from: plaisthos.

d12fk would like plaisthos to review this change.

V= iew Change

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, a= fter the
dns-updown script was disabled first. In that case the script p= ath is
NULL, which leads to the deref during a strcmp(3).

Reporte= d-by: <aarnav@...2953...>
Change-Id: Id530d890ba01cffb74d3dc04ad10= b153f7bea1d4
Signed-off-by: Heiko Hund <heiko@...2662...>
---M src/openvpn/options.c
1 file changed, 1 insertion(+), 1 deletion(-)<= br>
git pull ssh://gerrit.openvpn.net:29418/openvpn =
refs/changes/98/1498/1
diff --git a/src/openvpn/options.c b/src/ope=
nvpn/options.c
index 85669e0..2bca647 100644
--- a/src/openvpn/options.c
+++ b/src/openvpn/options.c
@@ -7890,7 +7890,7 @@
}
<= span> else

{
- if (streq(dns->updown, DEFAULT_DNS_U= PDOWN))
+ = if (dns->updown && streq(dns->updown, DEFAULT_DNS_UPDOWN))
{
/* Unset the = default command to prevent warnings */
dns= ->updown =3D NULL;

To view, visit change 149= 8. To unsubscribe, or for help writing mail filters, visit settings.

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