From: "cron2 (Code Review)" Date: Thu, 17 Apr 2025 14:05:31 +0000 In-Reply-To: References: Reply-To: gert@...1296..., arne-openvpn@...1227..., openvpn-devel@lists.sourceforge.net, frank@...2641..., lstipakov@...277..., antonio@...2726... Message-ID: <0774c11a09e1de40955d079607c82af4287ec824-EmailReplacePatchSet-HTML@...2715...> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Disposition: inline Content-Type: multipart/alternative; boundary="fxWYnrI/0Nk="; charset=UTF-8 Subject: [Openvpn-devel] [XS] Change in openvpn[master]: ssl_openssl.c: Prevent potential double-free List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: stipa , plaisthos , flichtenheld Cc: openvpn-devel --fxWYnrI/0Nk= Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable cron2 has uploaded a new patch set (#5) to the change originally created by= stipa. ( http://gerrit.openvpn.net/c/openvpn/+/942?usp=3Demail ) The following approvals got outdated and were removed: Code-Review+2 by ordex Change subject: ssl_openssl.c: Prevent potential double-free ...................................................................... ssl_openssl.c: Prevent potential double-free Fixes a potential double-free issue in tls_ctx_load_cert_uri() by explicitly nullifying the pointer immediately after calling OSSL_STORE_INFO_free(info). This ensures that subsequent cleanup won't attempt to free the same structure again. Github: closes OpenVPN/openvpn#726 Change-Id: I4507be07cd5573b2117e837ef03187535a38a4b1 Signed-off-by: Lev Stipakov Acked-by: Antonio Quartulli Message-Id: <20250417134636.21279-1-gert@...1296...> URL: https://www.mail-archive.com/openvpn-devel@lists.sourceforge.net/msg31= 478.html Signed-off-by: Gert Doering --- M src/openvpn/ssl_openssl.c 1 file changed, 2 insertions(+), 0 deletions(-) git pull ssh://gerrit.openvpn.net:29418/openvpn refs/changes/42/942/5 diff --git a/src/openvpn/ssl_openssl.c b/src/openvpn/ssl_openssl.c index d1d5d3e..f7be50c 100644 --- a/src/openvpn/ssl_openssl.c +++ b/src/openvpn/ssl_openssl.c @@ -1152,6 +1152,7 @@ goto end; } OSSL_STORE_INFO_free(info); + info =3D NULL; /* iterate through the store and add extra certificates if any to the = chain */ while (!OSSL_STORE_eof(store_ctx)) @@ -1170,6 +1171,7 @@ break; } OSSL_STORE_INFO_free(info); + info =3D NULL; } end: -- To view, visit http://gerrit.openvpn.net/c/openvpn/+/942?usp=3Demail To unsubscribe, or for help writing mail filters, visit http://gerrit.openv= pn.net/settings Gerrit-Project: openvpn Gerrit-Branch: master Gerrit-Change-Id: I4507be07cd5573b2117e837ef03187535a38a4b1 Gerrit-Change-Number: 942 Gerrit-PatchSet: 5 Gerrit-Owner: stipa Gerrit-Reviewer: flichtenheld Gerrit-Reviewer: ordex Gerrit-Reviewer: plaisthos Gerrit-CC: openvpn-devel Gerrit-MessageType: newpatchset --fxWYnrI/0Nk= Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable

cron2 uploaded patch set #5 to the change originally cr= eated by stipa.

View Change

The following approvals got outdated and= were removed: Code-Review+2 by ordex

ssl_openssl.c: Prevent potential double-free

= Fixes a potential double-free issue in tls_ctx_load_cert_uri()
by explic= itly nullifying the pointer immediately after calling
OSSL_STORE_INFO_fr= ee(info).

This ensures that subsequent cleanup won't attempt to = free the same
structure again.

Github: closes OpenVPN/openvpn#726=

Change-Id: I4507be07cd5573b2117e837ef03187535a38a4b1
Signed-off-= by: Lev Stipakov <lev@...515...>
Acked-by: Antonio Quartulli <a= ntonio@...2726...>
Message-Id: <20250417134636.21279-1-gert@...1826...= 6...>
URL: https://www.mail-archive.com/openvpn-devel@...1768...= ge.net/msg31478.html
Signed-off-by: Gert Doering <gert@...1296...>=
---
M src/openvpn/ssl_openssl.c
1 file changed, 2 insertions(+), = 0 deletions(-)

git pull ssh://gerrit.openvpn.net:29418/openvpn re=
fs/changes/42/942/5
diff --git a/src/openvpn/ssl_openssl.c b/src/op=
envpn/ssl_openssl.c
index d1d5d3e..f7be50c 100644--- a/src/openvpn/ssl_openssl.c
+++ b/src/openvpn/ss= l_openssl.c
@@ -1152,6 +1152,7 @@
= goto end;
}
OSSL_STORE_INFO_free(= info);
+ info =3D = NULL;

/* iterate through the store a= nd add extra certificates if any to the chain */
while= (!OSSL_STORE_eof(store_ctx))
@@ -1170,6 +1171,7 @@<= br> break;
}
= OSSL_STORE_INFO_free(info);
+ info =3D NULL;
}

end:

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

Gerrit-Project: openvpn
Gerrit-Branch: master
Gerrit-Change-Id: I4507be07cd5573b2117e837ef03= 187535a38a4b1
Gerrit-Change-Number: 942
Gerrit-PatchSet: 5
Gerrit-Owner: stipa <lstipakov@...277...>= ;
Gerrit-Reviewer: flichtenheld <frank@...2716...= 1...>
Gerrit-Reviewer: ordex <antonio@...2726...&= gt;
Gerrit-Reviewer: plaisthos <arne-openvpn@...1186...= .1227...>
Gerrit-CC: openvpn-devel <openvpn-devel@...1484...= ts.sourceforge.net>
Gerrit-MessageType: newpatchset
--fxWYnrI/0Nk=--