Attention is currently required from: flichtenheld, plaisthos.
Hello plaisthos, flichtenheld,
I'd like you to do a code review.
Please visit
http://gerrit.openvpn.net/c/openvpn/+/942?usp=email
to review the following change.
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 pointer
again.
Change-Id: I4507be07cd5573b2117e837ef03187535a38a4b1
Signed-off-by: Lev Stipakov <[email protected]>
---
M src/openvpn/ssl_openssl.c
1 file changed, 7 insertions(+), 1 deletion(-)
git pull ssh://gerrit.openvpn.net:29418/openvpn refs/changes/42/942/1
diff --git a/src/openvpn/ssl_openssl.c b/src/openvpn/ssl_openssl.c
index d1d5d3e..524cc00 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 = 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 = NULL;
}
end:
@@ -1184,7 +1186,11 @@
}
UI_destroy_method(ui_method);
- OSSL_STORE_INFO_free(info);
+ if (info)
+ {
+ OSSL_STORE_INFO_free(info);
+ info = NULL;
+ }
OSSL_STORE_close(store_ctx);
#else /* defined(HAVE_OPENSSL_STORE_API */
ASSERT(0);
--
To view, visit http://gerrit.openvpn.net/c/openvpn/+/942?usp=email
To unsubscribe, or for help writing mail filters, visit
http://gerrit.openvpn.net/settings
Gerrit-Project: openvpn
Gerrit-Branch: master
Gerrit-Change-Id: I4507be07cd5573b2117e837ef03187535a38a4b1
Gerrit-Change-Number: 942
Gerrit-PatchSet: 1
Gerrit-Owner: stipa <[email protected]>
Gerrit-Reviewer: flichtenheld <[email protected]>
Gerrit-Reviewer: plaisthos <[email protected]>
Gerrit-CC: openvpn-devel <[email protected]>
Gerrit-Attention: plaisthos <[email protected]>
Gerrit-Attention: flichtenheld <[email protected]>
Gerrit-MessageType: newchange
_______________________________________________
Openvpn-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/openvpn-devel