From patchwork Wed Nov 23 15:49:12 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Maximilian Fillinger X-Patchwork-Id: 2851 Return-Path: Delivered-To: patchwork@openvpn.net Delivered-To: patchwork@openvpn.net Received: from director10.mail.ord1d.rsapps.net ([172.27.255.9]) by backend30.mail.ord1d.rsapps.net with LMTP id SCytLr9EfmPDLQAAIUCqbw (envelope-from ) for ; Wed, 23 Nov 2022 11:05:19 -0500 Received: from proxy21.mail.iad3a.rsapps.net ([172.27.255.9]) by director10.mail.ord1d.rsapps.net with LMTP id YAJgLr9EfmMfOAAApN4f7A (envelope-from ) for ; Wed, 23 Nov 2022 11:05:19 -0500 Received: from smtp49.gate.iad3a ([172.27.255.9]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) by proxy21.mail.iad3a.rsapps.net with LMTPS id ABw7Jr9EfmOPOgAASBQwCQ (envelope-from ) for ; Wed, 23 Nov 2022 11:05:19 -0500 X-Spam-Threshold: 95 X-Spam-Score: 0 X-Spam-Flag: NO X-Virus-Scanned: OK X-Orig-To: openvpnslackdevel@openvpn.net X-Originating-Ip: [216.105.38.7] Authentication-Results: smtp49.gate.iad3a.rsapps.net; iprev=pass policy.iprev="216.105.38.7"; spf=pass smtp.mailfrom="openvpn-devel-bounces@lists.sourceforge.net" smtp.helo="lists.sourceforge.net"; dkim=fail (signature verification failed) header.d=sourceforge.net; dkim=fail (signature verification failed) header.d=sf.net; dkim=fail (key not found in DNS) header.d=foxcrypto.com; dmarc=fail (p=none; dis=none) header.from=foxcrypto.com X-Suspicious-Flag: YES X-Classification-ID: 9fe152ca-6b48-11ed-ac0e-525400fffce0-1-1 Received: from [216.105.38.7] ([216.105.38.7:38366] helo=lists.sourceforge.net) by smtp49.gate.iad3a.rsapps.net (envelope-from ) (ecelerity 4.2.38.62370 r(:)) with ESMTPS (cipher=DHE-RSA-AES256-GCM-SHA384) id 66/53-09165-EB44E736; Wed, 23 Nov 2022 11:05:19 -0500 Received: from [127.0.0.1] (helo=sfs-ml-1.v29.lw.sourceforge.com) by sfs-ml-1.v29.lw.sourceforge.com with esmtp (Exim 4.95) (envelope-from ) id 1oxsF2-0000Px-4m; Wed, 23 Nov 2022 16:04:52 +0000 Received: from [172.30.20.202] (helo=mx.sourceforge.net) by sfs-ml-1.v29.lw.sourceforge.com with esmtps (TLS1.2) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.95) (envelope-from ) id 1oxsF0-0000Pi-LE for openvpn-devel@lists.sourceforge.net; Wed, 23 Nov 2022 16:04:50 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=sourceforge.net; s=x; h=Content-Type:Content-Transfer-Encoding:MIME-Version :Message-ID:Date:Subject:CC:To:From:Sender:Reply-To:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:In-Reply-To:References:List-Id:List-Help:List-Unsubscribe: List-Subscribe:List-Post:List-Owner:List-Archive; bh=UyFfPCBMSGlu1OluKKXFaFQU4JTGA4+ZfCrX5G3Pex4=; b=fxaDfVdieaUpd3olPfrKl1arqq Yhf+iqlMIxdzkE7VEnQBdcAX/Js/QVDV91oWztTDsRMSHtzmnodQxhwqpbzfGNxwqmxb7LOf7n//U 8q9WBUbl2raS4jCAKPQFawg7Mxn1QMqFDRHrwHHe8uFsmQQhOp7nhjFFnU74Pll6K44M=; DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=sf.net; s=x ; h=Content-Type:Content-Transfer-Encoding:MIME-Version:Message-ID:Date: Subject:CC:To:From:Sender:Reply-To:Content-ID:Content-Description:Resent-Date :Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To: References:List-Id:List-Help:List-Unsubscribe:List-Subscribe:List-Post: List-Owner:List-Archive; bh=UyFfPCBMSGlu1OluKKXFaFQU4JTGA4+ZfCrX5G3Pex4=; b=B W9znHqTlWFUG3ZTE6K0WUuxdCc4a9qMfuoDOcn1Pmy0RsfEbO1PUiScIn3UYm37PdDkn2/stR4p08 le0UdKtK6g4u7JZgFCdeV262TZHSSD/t2uuJ69UQIWcKmPC5Sv0uxpF7qzQkf2z9iq37GuEPt/eQR v6NU0DUo2Wap798Q=; Received: from nl-dft-mx-01.fox-it.com ([178.250.144.135]) by sfi-mx-2.v28.lw.sourceforge.com with esmtps (TLS1.2:ECDHE-RSA-AES256-GCM-SHA384:256) (Exim 4.95) id 1oxsEu-0004oH-Gb for openvpn-devel@lists.sourceforge.net; Wed, 23 Nov 2022 16:04:50 +0000 From: Max Fillinger To: Date: Wed, 23 Nov 2022 16:49:12 +0100 Message-ID: <20221123154912.28394-1-maximilian.fillinger@foxcrypto.com> X-Mailer: git-send-email 2.30.2 MIME-Version: 1.0 X-ClientProxiedBy: FOXDFT1EX01.FOX.local (10.0.0.129) To FOXDFT1EX01.FOX.local (10.0.0.129) X-FE-Policy-ID: 13:3:2:SYSTEM DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; d=foxcrypto.com; s=NL-DFT-MX-01; c=relaxed/relaxed; h=from:to:cc:subject:date:message-id:mime-version:content-type; bh=UyFfPCBMSGlu1OluKKXFaFQU4JTGA4+ZfCrX5G3Pex4=; b=UTxdTLNAeKhHPnwU8soZ4VsFro2JgErpNpSP5K00YmM30nAhVYM9oObQ0+0eMne3a2OplNYhTpkr 7qGY4Bel/oek+mwM7AumkT7Ycg3mlMQxvP4awHceLSyevGMAJWFlYtRFeOTof2xO3vwphLLpiCe3 fo6c8wJYKLGVJ7jp3Mu8+HnxRPRJrPFdu4sYNYyIkJ5IqEWrowIiww8K9FS/CQf5KcF2q+VYc9I7 BqRn/9QU/rrP4RhJ1ktiP2Yc/e66c0eh1sWC9opaosW5QTcjd+50K225+VUnYz8/hLE2kU00eP9E vT6ssFMHr9+q1nMEErubaJp7d1hNOFPngl9tYg== X-Spam-Report: Spam detection software, running on the system "util-spamd-1.v13.lw.sourceforge.com", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see the administrator of that system for details. Content preview: When running openvpn --show-tls with mbedtls, it showed a null pointer error at the end because of this. Signed-off-by: Max Fillinger --- src/openvpn/ssl_mbedtls.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) Content analysis details: (0.2 points, 6.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record -0.0 SPF_PASS SPF: sender matches SPF record 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid 0.1 DKIM_INVALID DKIM or DK signature exists, but is not valid X-Headers-End: 1oxsEu-0004oH-Gb Subject: [Openvpn-devel] [PATCH] Check if pkcs11_cert is NULL before freeing it X-BeenThere: openvpn-devel@lists.sourceforge.net X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: openvpn-devel-bounces@lists.sourceforge.net X-getmail-retrieved-from-mailbox: Inbox When running openvpn --show-tls with mbedtls, it showed a null pointer error at the end because of this. Signed-off-by: Max Fillinger Acked-By: Arne Schwabe --- src/openvpn/ssl_mbedtls.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/openvpn/ssl_mbedtls.c b/src/openvpn/ssl_mbedtls.c index ea06cf70..aa55a1a0 100644 --- a/src/openvpn/ssl_mbedtls.c +++ b/src/openvpn/ssl_mbedtls.c @@ -165,7 +165,10 @@ tls_ctx_free(struct tls_root_ctx *ctx) free(ctx->crl); #if defined(ENABLE_PKCS11) - pkcs11h_certificate_freeCertificate(ctx->pkcs11_cert); + if (ctx->pkcs11_cert) + { + pkcs11h_certificate_freeCertificate(ctx->pkcs11_cert); + } #endif free(ctx->allowed_ciphers);