From: Frank Lichtenheld Date: Mon, 15 Dec 2025 15:56:47 +0000 (+0100) Subject: multi: Warn about failing read in multi_process_file_closed() X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;p=thirdparty%2Fopenvpn.git 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 Acked-by: Gert Doering Gerrit URL: https://gerrit.openvpn.net/c/openvpn/+/1443 Message-Id: <20251215155652.23362-1-gert@greenie.muc.de> URL: https://www.mail-archive.com/openvpn-devel@lists.sourceforge.net/msg35095.html Signed-off-by: Gert Doering --- diff --git a/src/openvpn/multi.c b/src/openvpn/multi.c index 92eac6ffd..329d0a3c3 100644 --- a/src/openvpn/multi.c +++ b/src/openvpn/multi.c @@ -2806,6 +2806,11 @@ multi_process_file_closed(struct multi_context *m, const unsigned int mpp_flags) char buffer[INOTIFY_EVENT_BUFFER_SIZE]; ssize_t buffer_i = 0; ssize_t r = 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; + } while (buffer_i < r) {