From: "plaisthos (Code Review)" Date: Mon, 27 Oct 2025 21:42:21 +0000 References: Reply-To: arne-openvpn@...1227..., openvpn-devel@lists.sourceforge.net, frank@...2641... Message-ID: <949b463c95683c9003dd43eb18117427ab93b42f-HTML@...2715...> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Disposition: inline Content-Type: multipart/alternative; boundary="Iz9WKN6Zcjg="; charset=UTF-8 Subject: [Openvpn-devel] [XS] Change in openvpn[master]: Add ASSERT to afunix code that dev_node is always the way we expect List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: flichtenheld Cc: openvpn-devel --Iz9WKN6Zcjg= Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Attention is currently required from: flichtenheld. Hello flichtenheld, I'd like you to do a code review. Please visit http://gerrit.openvpn.net/c/openvpn/+/1320?usp=3Demail to review the following change. Change subject: Add ASSERT to afunix code that dev_node is always the way w= e expect ...................................................................... Add ASSERT to afunix code that dev_node is always the way we expect The calling code only calls tun_afunix_exec_child if is_tun_afunix which checks that the path is having unix: as prefix. But since adding an ASSERT here to ensure that it is really the case does not cost us anything, just add the ASSERT. Reported-By: contact@...2949... Found-By: Zeropath Change-Id: Idbb7bf279eb467fc1d56ab75a50b5eb2c8d0a57e --- M src/openvpn/tun_afunix.c 1 file changed, 2 insertions(+), 0 deletions(-) git pull ssh://gerrit.openvpn.net:29418/openvpn refs/changes/20/1320/1 diff --git a/src/openvpn/tun_afunix.c b/src/openvpn/tun_afunix.c index 4d48a31..e6f2be1 100644 --- a/src/openvpn/tun_afunix.c +++ b/src/openvpn/tun_afunix.c @@ -53,6 +53,8 @@ const char *msgprefix =3D "ERROR: failure executing process for tun:"; struct argv argv =3D argv_new(); + /* we should always called with a proper unix: dev node string */ + ASSERT(dev_node && strncmp(dev_node, "unix:", strlen("unix:")) =3D=3D = 0); /* since we know that dev-node starts with unix: we can just skip that * to get the program name */ const char *program =3D dev_node + strlen("unix:"); -- To view, visit http://gerrit.openvpn.net/c/openvpn/+/1320?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: Idbb7bf279eb467fc1d56ab75a50b5eb2c8d0a57e Gerrit-Change-Number: 1320 Gerrit-PatchSet: 1 Gerrit-Owner: plaisthos Gerrit-Reviewer: flichtenheld Gerrit-CC: openvpn-devel Gerrit-Attention: flichtenheld --Iz9WKN6Zcjg= Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable

Attention is cur= rently required from: flichtenheld.

plaisthos would like flichtenheld to review this change.

V= iew Change

Add ASSERT to afunix code that dev_node is =
always the way we expect

The calling code only calls tun_afunix_exec= _child if is_tun_afunix
which checks that the path is having unix: as pr= efix.

But since adding an ASSERT here to ensure that it is really th= e case
does not cost us anything, just add the ASSERT.

Reported-B= y: contact@...2949...
Found-By: Zeropath
Change-Id: Idbb7bf279eb467fc= 1d56ab75a50b5eb2c8d0a57e
---
M src/openvpn/tun_afunix.c
1 file cha= nged, 2 insertions(+), 0 deletions(-)

git pull s=
sh://gerrit.openvpn.net:29418/openvpn refs/changes/20/1320/1
diff -=
-git a/src/openvpn/tun_afunix.c b/src/openvpn/tun_afunix.c
= index 4d48a31..e6f2be1 100644
--- a/src/openvpn/tun_afunix.= c
+++ b/src/openvpn/tun_afunix.c
@@ -53,6 += 53,8 @@
const char *msgprefix =3D "ERROR: failure= executing process for tun:";
struct argv argv = =3D argv_new();

+ /* we should always called with a proper unix: dev node s= tring */
+ ASSERT(= dev_node && strncmp(dev_node, "unix:", strlen("unix:= ")) =3D=3D 0);
/* since we know that dev-node sta= rts with unix: we can just skip that
* to get the pro= gram name */
const char *program =3D dev_node + strlen= ("unix:");

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

Gerrit-MessageType: newchange
Gerrit-Project: openvpn
Gerrit-Branch: master
Gerrit-Change-Id: Idbb7bf279eb467fc1d56ab75a50= b5eb2c8d0a57e
Gerrit-Change-Number: 1320
Gerrit-PatchSet: 1
Gerrit-Owner: plaisthos <arne-openvpn@...1711...= 27...>
Gerrit-Reviewer: flichtenheld <frank@...2716...= 1...>
Gerrit-CC: openvpn-devel <openvpn-devel@...1484...= ts.sourceforge.net>
Gerrit-Attention: flichtenheld <frank@...2375...= 41...>
= --Iz9WKN6Zcjg=--