From patchwork Sun Nov 27 08:59:33 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Arne Schwabe X-Patchwork-Id: 2860 Return-Path: Delivered-To: patchwork@openvpn.net Delivered-To: patchwork@openvpn.net Received: from director7.mail.ord1d.rsapps.net ([172.30.191.6]) by backend30.mail.ord1d.rsapps.net with LMTP id SPnpBi0ng2OZdQAAIUCqbw (envelope-from ) for ; Sun, 27 Nov 2022 04:00:29 -0500 Received: from proxy16.mail.ord1d.rsapps.net ([172.30.191.6]) by director7.mail.ord1d.rsapps.net with LMTP id 8GznBi0ng2PUewAAovjBpQ (envelope-from ) for ; Sun, 27 Nov 2022 04:00:29 -0500 Received: from smtp20.gate.ord1c ([172.30.191.6]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) by proxy16.mail.ord1d.rsapps.net with LMTPS id SA6oBi0ng2MlIAAAetu3IA (envelope-from ) for ; Sun, 27 Nov 2022 04:00:29 -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: smtp20.gate.ord1c.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; dmarc=none (p=nil; dis=none) header.from=rfc2549.org X-Suspicious-Flag: YES X-Classification-ID: f0348968-6e31-11ed-b8fd-bc305bf03180-1-1 Received: from [216.105.38.7] ([216.105.38.7:39380] helo=lists.sourceforge.net) by smtp20.gate.ord1c.rsapps.net (envelope-from ) (ecelerity 4.2.38.62370 r(:)) with ESMTPS (cipher=DHE-RSA-AES256-GCM-SHA384) id C8/5E-18667-C2723836; Sun, 27 Nov 2022 04:00:28 -0500 Received: from [127.0.0.1] (helo=sfs-ml-2.v29.lw.sourceforge.com) by sfs-ml-2.v29.lw.sourceforge.com with esmtp (Exim 4.95) (envelope-from ) id 1ozDW1-0008BQ-CX; Sun, 27 Nov 2022 08:59:57 +0000 Received: from [172.30.20.202] (helo=mx.sourceforge.net) by sfs-ml-2.v29.lw.sourceforge.com with esmtps (TLS1.2) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.95) (envelope-from ) id 1ozDVy-0008BI-9t for openvpn-devel@lists.sourceforge.net; Sun, 27 Nov 2022 08:59:54 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=sourceforge.net; s=x; h=Content-Transfer-Encoding:Content-Type:MIME-Version :Message-Id:Date:Subject:To:From:Sender:Reply-To:Cc: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=ARUBOS7GsceCebDFRaFwdnvN2LXSdv1jY1rdx9bHhI0=; b=ZFIx+RvgbqvhQasu46G5m5EXYS vuD23K9T9OgkUi4Kuie2Gm7qZk8NxbCPJcqsbXXKmZlatPf5GnR2a7r5ORh/OD0UVF+CYiaK2ClxF zE5oCLdtwe18KvmVyk91jF8J/9DBncJole9/gk9rgBKwI9Aw6bBmbIAm4VnnKtGvuMjA=; DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=sf.net; s=x ; h=Content-Transfer-Encoding:Content-Type:MIME-Version:Message-Id:Date: Subject:To:From:Sender:Reply-To:Cc: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=ARUBOS7GsceCebDFRaFwdnvN2LXSdv1jY1rdx9bHhI0=; b=E 5B4RecW/c3KIwT19sX8eWCzDftsTRmnCELly2Db1Kf/MjeUHD/WAuGuj4RIvUMyVL+6XCFENxXqm3 QExykAyGy5qj+QkyoQAXWu5Ek2EhgWyerjGcBW3kx+suk+OjbQ+t156YfDVlbZfFJ/AcYNFqP48CP cvaBxMEaT/bJ3MeI=; Received: from mail.blinkt.de ([192.26.174.232]) by sfi-mx-2.v28.lw.sourceforge.com with esmtps (TLS1.2:ECDHE-RSA-AES256-GCM-SHA384:256) (Exim 4.95) id 1ozDVo-0005IB-Dj for openvpn-devel@lists.sourceforge.net; Sun, 27 Nov 2022 08:59:46 +0000 Received: from kamera.blinkt.de ([2001:638:502:390:20c:29ff:fec8:535c]) by mail.blinkt.de with smtp (Exim 4.95 (FreeBSD)) (envelope-from ) id 1ozDVd-000I8c-7L for openvpn-devel@lists.sourceforge.net; Sun, 27 Nov 2022 09:59:33 +0100 Received: (nullmailer pid 3487223 invoked by uid 10006); Sun, 27 Nov 2022 08:59:33 -0000 From: Arne Schwabe To: openvpn-devel@lists.sourceforge.net Date: Sun, 27 Nov 2022 09:59:33 +0100 Message-Id: <20221127085933.3487177-1-arne@rfc2549.org> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 X-Spam-Report: =?unknown-8bit?q?Spam_detection_software=2C_running_on_the_sy?= =?unknown-8bit?q?stem_=22util-spamd-1=2Ev13=2Elw=2Esourceforge=2Ecom=22=2C?= =?unknown-8bit?q?_has_NOT_identified_this_incoming_email_as_spam=2E__The_ori?= =?unknown-8bit?q?ginal?= =?unknown-8bit?q?_message_has_been_attached_to_this_so_you_can_view_it_or_la?= =?unknown-8bit?q?bel?= =?unknown-8bit?q?_similar_future_email=2E__If_you_have_any_questions=2C_see?= =?unknown-8bit?q?_the_administrator_of_that_system_for_details=2E?= =?unknown-8bit?q?_?= =?unknown-8bit?q?_Content_preview=3A__Changing_the_argument_of_check=5Fmallo?= =?unknown-8bit?q?c=5Freturn_from_const_void*?= =?unknown-8bit?q?_to_void*_removes_the_warning_from_gcc_12=2E2=2E0=3A_In_fil?= =?unknown-8bit?q?e_included_from_=2E=2E/=2E=2E/=2E=2E/openvpn-git/src/openv?= =?unknown-8bit?q?pn/crypto=5Fopenssl=2Ec=3A40=3A?= =?unknown-8bit?b?IC4uLy4uLy4uL29wZW52cG4tZ2l0L3NyYy9vcGVudnBuL2J1ZmZlci5o?= =?unknown-8bit?b?OiBJbiBmdW5jdGlvbiDigJhobWFjX2N0eF9uZXfigJk6?= =?unknown-8bit?b?IC4uLy4uLy4uL29wZW52cG4tZ2l0L3NyYy9vcGVudnBuL2J1ZmZlci5o?= =?unknown-8bit?b?OjEwMzA6OTogWy4uLl0g?= =?unknown-8bit?q?_?= =?unknown-8bit?q?_Content_analysis_details=3A___=280=2E3_points=2C_6=2E0_req?= =?unknown-8bit?q?uired=29?= =?unknown-8bit?q?_?= =?unknown-8bit?q?_pts_rule_name______________description?= =?unknown-8bit?q?_----_----------------------_------------------------------?= =?unknown-8bit?q?--------------------?= =?unknown-8bit?q?_0=2E0_SPF=5FHELO=5FNONE__________SPF=3A_HELO_does_not_publ?= =?unknown-8bit?q?ish_an_SPF_Record?= =?unknown-8bit?q?_0=2E2_HEADER=5FFROM=5FDIFFERENT=5FDOMAINS_From_and_Envelop?= =?unknown-8bit?q?eFrom_2nd_level?= =?unknown-8bit?q?_mail_domains_are_different?= =?unknown-8bit?q?_0=2E0_SPF=5FNONE_______________SPF=3A_sender_does_not_publ?= =?unknown-8bit?q?ish_an_SPF_Record?= X-Headers-End: 1ozDVo-0005IB-Dj Subject: [Openvpn-devel] [PATCH] [RFC] fix warning with gcc 12.2.0 (compiler bug?) 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 Changing the argument of check_malloc_return from const void* to void* removes the warning from gcc 12.2.0: In file included from ../../../openvpn-git/src/openvpn/crypto_openssl.c:40: ../../../openvpn-git/src/openvpn/buffer.h: In function ‘hmac_ctx_new’: ../../../openvpn-git/src/openvpn/buffer.h:1030:9: warning: ‘ctx’ may be used uninitialized [-Wmaybe-uninitialized] 1030 | check_malloc_return((dptr) = (type *) malloc(sizeof(type))); \ | ^~~~~~~~~~~~~~~~~~~ ../../../openvpn-git/src/openvpn/buffer.h:1076:1: note: by argument 1 of type ‘const void *’ to ‘check_malloc_return’ declared here 1076 | check_malloc_return(const void *p) | ^~~~~~~~~~~~~~~~~~~ This more a quick fix/heads up for other people encountering the issue on GCC 12.2.0 like on Ubuntu 22.10 until we figure out if this is a bug in our code or a compiler bug. Signed-off-by: Arne Schwabe Acked-By: Frank Lichtenheld Acked-by: Heiko Hund --- src/openvpn/buffer.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/openvpn/buffer.h b/src/openvpn/buffer.h index fece6336d..9ad281562 100644 --- a/src/openvpn/buffer.h +++ b/src/openvpn/buffer.h @@ -1073,7 +1073,7 @@ gc_reset(struct gc_arena *a) } static inline void -check_malloc_return(const void *p) +check_malloc_return(void *p) { if (!p) {