From: "cron2 (Code Review)" Date: Fri, 8 May 2026 15:48:45 +0000 In-Reply-To: References: Reply-To: gert@...1296..., arne-openvpn@...1227..., openvpn-devel@lists.sourceforge.net, frank@...2641... Message-ID: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Disposition: inline Content-Type: multipart/alternative; boundary="sYFihn8jrRE="; charset=UTF-8 Subject: [Openvpn-devel] [XS] Change in openvpn[master]: dco_freebsd: Add check_malloc_return after realloc List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: flichtenheld , plaisthos Cc: openvpn-devel --sYFihn8jrRE= Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable cron2 has uploaded a new patch set (#3) to the change originally created by= flichtenheld. ( http://gerrit.openvpn.net/c/openvpn/+/1669?usp=3Demail ) The following approvals got outdated and were removed: Code-Review+2 by cron2 Change subject: dco_freebsd: Add check_malloc_return after realloc ...................................................................... dco_freebsd: Add check_malloc_return after realloc cppcheck complained about a potential memleak due to realloc failure. But trying to handle that is probably not useful. Just abort like we do for other malloc failures. Change-Id: Icd8ea093dfe9f1888570f3d7b786b951b5262e47 Signed-off-by: Frank Lichtenheld Acked-by: Gert Doering Gerrit URL: https://gerrit.openvpn.net/c/openvpn/+/1669 Message-Id: <20260507075321.25123-1-gert@...1296...> URL: https://www.mail-archive.com/openvpn-devel@lists.sourceforge.net/msg36= 842.html Signed-off-by: Gert Doering --- M dev-tools/cppcheck-suppression M src/openvpn/dco_freebsd.c 2 files changed, 3 insertions(+), 0 deletions(-) git pull ssh://gerrit.openvpn.net:29418/openvpn refs/changes/69/1669/3 diff --git a/dev-tools/cppcheck-suppression b/dev-tools/cppcheck-suppression index 1f31edb..439cbb1 100644 --- a/dev-tools/cppcheck-suppression +++ b/dev-tools/cppcheck-suppression @@ -44,6 +44,8 @@ knownConditionTrueFalse:src/openvpnmsica/dllmain.c:164 # FP: cppcheck seems to be confused since we cast the pointer to integer memleak:src/plugins/down-root/down-root.c:337 +# IGN: we just abort instead +memleakOnRealloc:src/openvpn/dco_freebsd.c:845 # FP: eventmsg.h is not built on Unix missingInclude:src/openvpnserv/common.c:25 # IGN: strlen(NULL) is not nice code, but seems to work diff --git a/src/openvpn/dco_freebsd.c b/src/openvpn/dco_freebsd.c index 718cd8b..eaca86b 100644 --- a/src/openvpn/dco_freebsd.c +++ b/src/openvpn/dco_freebsd.c @@ -842,6 +842,7 @@ retry: buf =3D realloc(buf, buf_size); + check_malloc_return(buf); drv.ifd_len =3D buf_size; drv.ifd_data =3D buf; -- To view, visit http://gerrit.openvpn.net/c/openvpn/+/1669?usp=3Demail To unsubscribe, or for help writing mail filters, visit http://gerrit.openv= pn.net/settings?usp=3Demail Gerrit-MessageType: newpatchset Gerrit-Project: openvpn Gerrit-Branch: master Gerrit-Change-Id: Icd8ea093dfe9f1888570f3d7b786b951b5262e47 Gerrit-Change-Number: 1669 Gerrit-PatchSet: 3 Gerrit-Owner: flichtenheld Gerrit-Reviewer: cron2 Gerrit-Reviewer: plaisthos Gerrit-CC: openvpn-devel --sYFihn8jrRE= Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable

cron2 upl= oaded patch set #3 to the change originally created by flichtenhel= d.

View Change

The following approvals got outdated and were remove= d: Code-Review+2 by cron2

dco_freebsd: Add check_malloc_retur=
n after realloc

cppcheck complained about a potential memleak
due= to realloc failure. But trying to handle that
is probably not useful. J= ust abort like we do
for other malloc failures.

Change-Id: Icd8ea= 093dfe9f1888570f3d7b786b951b5262e47
Signed-off-by: Frank Lichtenheld <= ;frank@...2641...>
Acked-by: Gert Doering <gert@...1296...>
= Gerrit URL: https://gerrit.openvpn.net/c/openvpn/+/1669
Message-Id: <= 20260507075321.25123-1-gert@...1296...>
URL: https://www.mail-archive= .com/openvpn-devel@lists.sourceforge.net/msg36842.html
Signed-off-by: Ge= rt Doering <gert@...1296...>
---
M dev-tools/cppcheck-suppressi= on
M src/openvpn/dco_freebsd.c
2 files changed, 3 insertions(+), 0 de= letions(-)

git pull ssh://gerrit.openvpn.net:294=
18/openvpn refs/changes/69/1669/3
diff --git a/dev-tools/cppcheck-s=
uppression b/dev-tools/cppcheck-suppression
index 1f31edb..= 439cbb1 100644
--- a/dev-tools/cppcheck-suppression<= br>+++ b/dev-tools/cppcheck-suppression
@@ -44,6 +44,= 8 @@
knownConditionTrueFalse:src/openvpnmsica/dllmain.c:16= 4
# FP: cppcheck seems to be confused since we cast the po= inter to integer
memleak:src/plugins/down-root/down-root.c= :337
+# IGN: we just = abort instead
+memlea= kOnRealloc:src/openvpn/dco_freebsd.c:845
# FP: eventmsg.h = is not built on Unix
missingInclude:src/openvpnserv/common= .c:25
# IGN: strlen(NULL) is not nice code, but seems to w= ork
diff --git a/src/openvpn/dco_freebsd.c b/src/openvpn/dc= o_freebsd.c
index 718cd8b..eaca86b 100644
-= -- a/src/openvpn/dco_freebsd.c
+++ b/src/openvpn/dco_freebs= d.c
@@ -842,6 +842,7 @@

= retry:
buf =3D realloc(buf, buf_size);
+ check_malloc_return(buf);
drv.ifd_len =3D buf_size;
drv.ifd_data= =3D buf;


To view, vi= sit chan= ge 1669. To unsubscribe, or for help writing mail filters, visit settings.

Gerrit-MessageType: newpatchset
Gerrit-Project: openvpn
Gerrit-Branch: master
Gerrit-Change-Id: Icd8ea093dfe9f1888570f3d7b78= 6b951b5262e47
Gerrit-Change-Number: 1669
Gerrit-PatchSet: 3
Gerrit-Owner: flichtenheld <frank@...2723...= .>
Gerrit-Reviewer: cron2 <gert@...1296...>=
Gerrit-Reviewer: plaisthos <arne-openvpn@...1186...= .1227...>
Gerrit-CC: openvpn-devel <openvpn-devel@...1484...= ts.sourceforge.net>
= --sYFihn8jrRE=--