From: "flichtenheld (Code Review)" Date: Mon, 15 Dec 2025 15:50:44 +0000 References: Reply-To: frank@...2641..., 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="L0TOPUMxaWc="; charset=UTF-8 Subject: [Openvpn-devel] [XS] Change in openvpn[master]: multi: Warn about failing read in multi_process_file_closed() List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: plaisthos Cc: openvpn-devel --L0TOPUMxaWc= 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/+/1443?usp=3Demail to review the following change. Change subject: multi: Warn about failing read in multi_process_file_closed= () ...................................................................... multi: Warn about failing read in multi_process_file_closed() Handle failure explicitly instead of the implicit handling by "while (buffer_i < r)". That error checking was previously broken but was fixed by commit 5e5ead5ba019fc2a8266f77a7d840b30fd545198. Reported-by: Marc Heuse Github: openvpn-private-issues#101 Change-Id: Ie982f620a8af80564a70d993e6e84ec4e525236a Signed-off-by: Frank Lichtenheld --- M src/openvpn/multi.c 1 file changed, 5 insertions(+), 0 deletions(-) git pull ssh://gerrit.openvpn.net:29418/openvpn refs/changes/43/1443/1 diff --git a/src/openvpn/multi.c b/src/openvpn/multi.c index 92eac6f..329d0a3 100644 --- a/src/openvpn/multi.c +++ b/src/openvpn/multi.c @@ -2806,6 +2806,11 @@ char buffer[INOTIFY_EVENT_BUFFER_SIZE]; ssize_t buffer_i =3D 0; ssize_t r =3D read(m->top.c2.inotify_fd, buffer, INOTIFY_EVENT_BUFFER_= SIZE); + if (r < 0) + { + msg(M_WARN | M_ERRNO, "MULTI: multi_process_file_closed error"); + return; + } =20 while (buffer_i < r) { -- To view, visit http://gerrit.openvpn.net/c/openvpn/+/1443?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: Ie982f620a8af80564a70d993e6e84ec4e525236a Gerrit-Change-Number: 1443 Gerrit-PatchSet: 1 Gerrit-Owner: flichtenheld Gerrit-Reviewer: plaisthos Gerrit-CC: openvpn-devel Gerrit-Attention: plaisthos --L0TOPUMxaWc= Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable

Attention is cur= rently required from: plaisthos.

flichtenheld would like plaisthos to review this change.

V= iew Change

multi: Warn about failing read in multi_pro=
cess_file_closed()

Handle failure explicitly instead of the implicit=
handling by "while (buffer_i < r)". That error
checking= was previously broken but was fixed by
commit 5e5ead5ba019fc2a8266f77a7= d840b30fd545198.

Reported-by: Marc Heuse <marc@...2953...>
= Github: openvpn-private-issues#101
Change-Id: Ie982f620a8af80564a70d993e= 6e84ec4e525236a
Signed-off-by: Frank Lichtenheld <frank@...2641...>= ;
---
M src/openvpn/multi.c
1 file changed, 5 insertions(+), 0 del= etions(-)

git pull ssh://gerrit.openvpn.net:2941=
8/openvpn refs/changes/43/1443/1
diff --git a/src/openvpn/multi.c b=
/src/openvpn/multi.c
index 92eac6f..329d0a3 100644--- a/src/openvpn/multi.c
+++ b/src/openvpn/multi.c=
@@ -2806,6 +2806,11 @@
char buffer[IN= OTIFY_EVENT_BUFFER_SIZE];
ssize_t buffer_i =3D 0;
ssize_t r =3D read(m->top.c2.inotify_fd, buffer, INOTIF= Y_EVENT_BUFFER_SIZE);
+ if (r < 0)
+= {
+ msg(M_= WARN | M_ERRNO, "MULTI: multi_process_file_closed error");=
+ return;
= + }
=
while (buffer_i < r)
{

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

Gerrit-MessageType: newchange
Gerrit-Project: openvpn
Gerrit-Branch: master
Gerrit-Change-Id: Ie982f620a8af80564a70d993e6e= 84ec4e525236a
Gerrit-Change-Number: 1443
Gerrit-PatchSet: 1
Gerrit-Owner: flichtenheld <frank@...2723...= .>
Gerrit-Reviewer: plaisthos <arne-openvpn@...1186...= .1227...>
Gerrit-CC: openvpn-devel <openvpn-devel@...1484...= ts.sourceforge.net>
Gerrit-Attention: plaisthos <arne-openvpn@...220...= ..1227...>
= --L0TOPUMxaWc=--