From patchwork Thu May 7 07:53:15 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Gert Doering X-Patchwork-Id: 4921 Return-Path: Delivered-To: patchwork@openvpn.net Received: by 2002:a05:7000:9b50:b0:84a:48f:a1fd with SMTP id b16csp3533343max; Thu, 7 May 2026 00:53:38 -0700 (PDT) X-Forwarded-Encrypted: i=2; AFNElJ+YcawiLsr1LKLdvZhVIklYx3GshhfPFpit0TQ8ZKy1YwjFu9ALFcoMrCso/UpLI6AoN8r06yEO3RE=@openvpn.net X-Received: by 2002:a05:6871:d043:b0:409:a4d3:a30e with SMTP id 586e51a60fabf-434f5debb3bmr4232114fac.2.1778140418565; Thu, 07 May 2026 00:53:38 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1778140418; cv=none; d=google.com; s=arc-20240605; b=jqdlIlQXT9EvWIRLPCn5+DkUZTM+v6NAfIiDArhBxWRP5J7TE54DaLhKiflHSMUIvX YzVZ+fP1chtKDfbnMx+X04ct5okSmC6lLyfp8HadgAYtgvxquVkadd6DPBZANs9oEKth ASgyuFW0pippl24CfGkmWPk94eml3s5fe1iA+AwX5G/4HS09aQRsle09cTGx3uW6hZVS 4J0KdqCvwF0UN7gofIgV/qP0WsozLv/cYAU5eufyQH0Jnbe2IYtnsOTx0NwFBYyPgVkT sQIcV10zMZEWpqg5hHiTVX36JlOa16po8nCrHsqCgSeY1W8SoKOUx0HTiOFoXB/U/WIm tNKA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20240605; h=errors-to:content-transfer-encoding:list-subscribe:list-help :list-post:list-archive:list-unsubscribe:list-id:precedence:subject :mime-version:references:in-reply-to:message-id:date:to:from :dkim-signature:dkim-signature:dkim-signature; bh=9Fsibw3cYwaT67NaFdFYc7cNd8wMT+gT33Hsn0Dg48w=; fh=4NbAC/LsuMLI0S0hprUlLSLCiHwg6SCAifhH718Jh0Q=; b=cxqGFNPOs5jml1Ivv86yGj8OTE7+gsfB+/Z7m8mMITlp1M0cnpud/5h/h2pz87oMF1 i5OUOMT3fLWd/tvYYi7ln27o4i2FyhZr524cd0gZbmn23bubPLZ612wWcjTJvUhgzgzN MKEj4IryKzvcgrwNRafhpFqn2O2gEYtTWrXyt6waOLKDV9o4DHfuOVgv7O5BcSAr5ecu Ytc2E7IIspA8BcAy1cOBdk3cl0bVe6hcbHn1nlmaT2MjWTxRrdGGlJpx3ZFbunUppkRo Q/wwq8dPtG8FkrW7gVvmgDC2QdOwDu671eUgggPRy2vZakY5IDHrwXzkqxjkNGYIuL0h 7tJA==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@lists.sourceforge.net header.s=beta header.b=GfjwzFyv; dkim=neutral (body hash did not verify) header.i=@sourceforge.net header.s=x header.b=GrMiUdZC; dkim=neutral (body hash did not verify) header.i=@sf.net header.s=x header.b=OoXaZ0yp; spf=pass (google.com: domain of openvpn-devel-bounces@lists.sourceforge.net designates 216.105.38.7 as permitted sender) smtp.mailfrom=openvpn-devel-bounces@lists.sourceforge.net; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=muc.de Received: from lists.sourceforge.net (lists.sourceforge.net. [216.105.38.7]) by mx.google.com with ESMTPS id 586e51a60fabf-43537980b47si393458fac.143.2026.05.07.00.53.38 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Thu, 07 May 2026 00:53:38 -0700 (PDT) Received-SPF: pass (google.com: domain of openvpn-devel-bounces@lists.sourceforge.net designates 216.105.38.7 as permitted sender) client-ip=216.105.38.7; Authentication-Results: mx.google.com; dkim=pass header.i=@lists.sourceforge.net header.s=beta header.b=GfjwzFyv; dkim=neutral (body hash did not verify) header.i=@sourceforge.net header.s=x header.b=GrMiUdZC; dkim=neutral (body hash did not verify) header.i=@sf.net header.s=x header.b=OoXaZ0yp; spf=pass (google.com: domain of openvpn-devel-bounces@lists.sourceforge.net designates 216.105.38.7 as permitted sender) smtp.mailfrom=openvpn-devel-bounces@lists.sourceforge.net; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=muc.de DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.sourceforge.net; s=beta; h=Content-Transfer-Encoding:Content-Type: List-Subscribe:List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id: Subject:MIME-Version:References:In-Reply-To:Message-ID:Date:To:From:Sender: Reply-To:Cc:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=9Fsibw3cYwaT67NaFdFYc7cNd8wMT+gT33Hsn0Dg48w=; b=GfjwzFyvc6OW5nKQYhGLftjas7 vi23X0mpHd+XZNk5rOQ12VlSvfj5RtacDc3uhr8gqBAcN921zKLZUNf6XHc1X6DcSsZ09BqHSJY/7 yc20g+xsTJ33Aezs/L1uJsfTV8BJb4knx3UwweTBEZjRVTZ5EoClSvgk7inQlzHbyM60=; Received: from [127.0.0.1] (helo=sfs-ml-4.v29.lw.sourceforge.com) by sfs-ml-4.v29.lw.sourceforge.com with esmtp (Exim 4.95) (envelope-from ) id 1wKtY8-00042w-IS; Thu, 07 May 2026 07:53:36 +0000 Received: from [172.30.29.66] (helo=mx.sourceforge.net) by sfs-ml-4.v29.lw.sourceforge.com with esmtps (TLS1.2) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.95) (envelope-from ) id 1wKtY7-00042q-0b for openvpn-devel@lists.sourceforge.net; Thu, 07 May 2026 07:53:35 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=sourceforge.net; s=x; h=Content-Transfer-Encoding:MIME-Version:References: In-Reply-To:Message-ID:Date:Subject:To:From:Sender:Reply-To:Cc:Content-Type: Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender: Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help:List-Unsubscribe: List-Subscribe:List-Post:List-Owner:List-Archive; bh=/pw7j/4iqQrRoXb5484w3jH0schNSHlqwIQqzERcT2A=; b=GrMiUdZCSPW8mbJ/MP+3x+Mkxp 2ZIGOJTOkCySB1y4/DUkuVzhBuqPygsZpoc2Ew57lHPFSTeq8cvge66cbq7GUNTYIQeZsZuLRZWhd E/ETyhQDhK9WRWXf3n4+3D2dUyqhoHLB/UaGWHIcW4sSRxDHTpx1owekeD7oSbx+s6A8=; DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=sf.net; s=x ; h=Content-Transfer-Encoding:MIME-Version:References:In-Reply-To:Message-ID: Date:Subject:To:From:Sender:Reply-To:Cc:Content-Type:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Id:List-Help:List-Unsubscribe:List-Subscribe: List-Post:List-Owner:List-Archive; bh=/pw7j/4iqQrRoXb5484w3jH0schNSHlqwIQqzERcT2A=; b=OoXaZ0ypjJKNGNmW4vzGB0dEp7 GHQFD6UJeIvbFII1uvCOzjLe41/OdcX4uwgtCLxlhGL6ZyIAnGH52hkAMJobXFKea9NaQ8VhXSJr9 7UT9to9EB0UkQzIsUdW3qIBL5i1WHBuFd8b0jhA9FbgjMTVNENl7Ek818mW+mn0lBkv0=; Received: from [193.149.48.129] (helo=blue.greenie.muc.de) by sfi-mx-2.v28.lw.sourceforge.com with esmtps (TLS1.2:ECDHE-RSA-AES256-GCM-SHA384:256) (Exim 4.95) id 1wKtY5-0005X1-Ch for openvpn-devel@lists.sourceforge.net; Thu, 07 May 2026 07:53:34 +0000 Received: from blue.greenie.muc.de (localhost [127.0.0.1]) by blue.greenie.muc.de (8.18.1/8.18.1) with ESMTP id 6477rLi1025149 for ; Thu, 7 May 2026 09:53:21 +0200 Received: (from gert@localhost) by blue.greenie.muc.de (8.18.1/8.18.1/Submit) id 6477rLwO025148 for openvpn-devel@lists.sourceforge.net; Thu, 7 May 2026 09:53:21 +0200 From: Gert Doering To: openvpn-devel@lists.sourceforge.net Date: Thu, 7 May 2026 09:53:15 +0200 Message-ID: <20260507075321.25123-1-gert@greenie.muc.de> X-Mailer: git-send-email 2.52.0 In-Reply-To: References: MIME-Version: 1.0 X-Spam-Score: 1.3 (+) X-Spam-Report: Spam detection software, running on the system "sfi-spamd-1.hosts.colo.sdot.me", 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: From: Frank Lichtenheld 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. Content analysis details: (1.3 points, 5.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- 0.0 RCVD_IN_DNSWL_BLOCKED RBL: ADMINISTRATOR NOTICE: The query to DNSWL was blocked. See http://wiki.apache.org/spamassassin/DnsBlocklists#DnsBlocklists-dnsbl-block for more information. [193.149.48.129 listed in list.dnswl.org] 1.3 RDNS_NONE Delivered to internal network by a host with no rDNS X-Headers-End: 1wKtY5-0005X1-Ch Subject: [Openvpn-devel] [PATCH v1] dco_freebsd: Add check_malloc_return after realloc 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 X-GMAIL-THRID: =?utf-8?q?1864515367136826328?= X-GMAIL-MSGID: =?utf-8?q?1864515367136826328?= From: Frank Lichtenheld 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 --- This change was reviewed on Gerrit and approved by at least one developer. I request to merge it to master. Gerrit URL: https://gerrit.openvpn.net/c/openvpn/+/1669 This mail reflects revision 1 of this Change. Acked-by according to Gerrit (reflected above): Gert Doering diff --git a/dev-tools/cppcheck-suppression b/dev-tools/cppcheck-suppression index 1fefb51..c9d4714 100644 --- a/dev-tools/cppcheck-suppression +++ b/dev-tools/cppcheck-suppression @@ -49,6 +49,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 = realloc(buf, buf_size); + check_malloc_return(buf); drv.ifd_len = buf_size; drv.ifd_data = buf;