From patchwork Tue Jan 9 11:09:01 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "plaisthos (Code Review)" X-Patchwork-Id: 3556 Return-Path: Delivered-To: patchwork@openvpn.net Received: by 2002:a05:7300:a213:b0:100:d2e5:60d with SMTP id bs19csp30782dyb; Tue, 9 Jan 2024 03:09:39 -0800 (PST) X-Google-Smtp-Source: AGHT+IFmlpRT5LhMN5UhJYO0Gyn4qMZ6vm4Szf1ZYcVTt92aE+zMyrhLRgddmTgM/iNQmwF1l/pS X-Received: by 2002:a17:90a:ce08:b0:28b:3637:e246 with SMTP id f8-20020a17090ace0800b0028b3637e246mr8067908pju.4.1704798579661; Tue, 09 Jan 2024 03:09:39 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1704798579; cv=none; d=google.com; s=arc-20160816; b=U6tjEpXU5tgoUV2klQtZGSYAAv+BwZR3bVfSqIH4VCJd4mZW7dybtFvqTPut7VxPfq Hw89SUNOWOUs+WwcAf+NnLyV2Mhme1UvJDJ7qS/Fhkkbpwm1IVuh9a/SYxzGUXasJIe3 B9/YiV2mRcm2VVdmmPoJk2Afkc5Uew6inVkzvM/N8BH4Z2RFPdKfDMhDNm44Cuq62ePW OSoMF33rAQmxAHXvIMKBksgr+7sDYQ+FiY9IbXa16D2Q2ae2WdRzOIuPEw05/+5hA5WS +AEg2ep8F8gVID2kE4+r9CRCR+oq7N8sYyVtSRL/Wm5LTi3gNgHy8/ZWV9PwH+AFxwWP YVyQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=errors-to:cc:reply-to:list-subscribe:list-help:list-post :list-archive:list-unsubscribe:list-id:precedence:subject:user-agent :mime-version:message-id:references:auto-submitted:to:date:from :dkim-signature:dkim-signature:dkim-signature; bh=zuVMj1Be0YfDdvvAsrM4PlNjKXYeaxFVCIRpnoVkUU0=; fh=GFP4qDxgyJ2WEPo/oeLZg3Mj4NqvY1j2nTvTt7psNwg=; b=ocXUuraX57GYVVysjAH6Zwf5mPcU10cpjwTznVJx5XyZUH/0hEWVMOZaI9Dp2eAf2A uAj68SvS/XaUlo0/FJKBaq7UeGXUgE9/RZ6OfvTx8SO9XDKfpXbgapiqnx3LI5db59/R bqJvQUFC0BmeLVXdgKuxg7PVIJNf14y+nm+ZpQ9CRMB8GNvVSVwAGWYMDoYwlFoL6P8Z KCX0omGwkVBItmKwxuzaUHqVRNCUKBhug7sdy5q+GRuDhisPMuv/LXRr5DQ+W0KZ33Eh Z5oeI7qcWZfCKTFW837h23lYbfAbkB9UmrSJJEcDsn3sd5FJ+Zz3ap+1LujVwASBaXmh j/DA== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@sourceforge.net header.s=x header.b=GEGzL88M; dkim=neutral (body hash did not verify) header.i=@sf.net header.s=x header.b=kQ3zXcq4; dkim=neutral (body hash did not verify) header.i=@openvpn.net header.s=google header.b=XxGdiGwk; 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=openvpn.net Received: from lists.sourceforge.net (lists.sourceforge.net. [216.105.38.7]) by mx.google.com with ESMTPS id q11-20020a17090a304b00b0028bf2811d79si1310122pjl.100.2024.01.09.03.09.39 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Tue, 09 Jan 2024 03:09:39 -0800 (PST) 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=neutral (body hash did not verify) header.i=@sourceforge.net header.s=x header.b=GEGzL88M; dkim=neutral (body hash did not verify) header.i=@sf.net header.s=x header.b=kQ3zXcq4; dkim=neutral (body hash did not verify) header.i=@openvpn.net header.s=google header.b=XxGdiGwk; 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=openvpn.net Received: from [127.0.0.1] (helo=sfs-ml-3.v29.lw.sourceforge.com) by sfs-ml-3.v29.lw.sourceforge.com with esmtp (Exim 4.95) (envelope-from ) id 1rN9yw-0003ze-2T; Tue, 09 Jan 2024 11:09:18 +0000 Received: from [172.30.20.202] (helo=mx.sourceforge.net) by sfs-ml-3.v29.lw.sourceforge.com with esmtps (TLS1.2) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.95) (envelope-from ) id 1rN9ys-0003zV-7E for openvpn-devel@lists.sourceforge.net; Tue, 09 Jan 2024 11:09:16 +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:Reply-To:References:Subject:List-Unsubscribe:List-Id:Cc:To:Date: From:Sender:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:List-Help: List-Subscribe:List-Post:List-Owner:List-Archive; bh=WH3WLbOEFkjbREw4J2aTshdcidMX82MYfoxjXvQrelg=; b=GEGzL88Mql7FAdGcKcT7tNQUW9 8QW6tHhPyej4luM7kKHAQ2R+uqtJi3F+ko4G8Bbg0l/FOm8sROhnI33kRF3mdFvM4K3tM7I7hzQuL 2j25SiXgBjWKPupaMoKSEvd8Wej1a4XDMs3Ay1ksLw35Sq+UFuPwzed+kXVgv6QdZnXg=; 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:Reply-To: References:Subject:List-Unsubscribe:List-Id:Cc:To:Date:From:Sender:Content-ID :Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To: Resent-Cc:Resent-Message-ID:In-Reply-To:List-Help:List-Subscribe:List-Post: List-Owner:List-Archive; bh=WH3WLbOEFkjbREw4J2aTshdcidMX82MYfoxjXvQrelg=; b=k Q3zXcq4NGFhH0kAN2SsSGPYambLTp83pqKEDVmGsIe/bjU0Ua/5C9x0GGV9iJLUywWt0Ql0jp+35P HAfzhDQolIeKP9PrHa+5eYZgBwB1U1vPXQqnDKDRicty6T1yu6fmzJtdVStBGtGUrrF0FyNkk8sNG mK5tJJ01E8njLpsg=; Received: from mail-wr1-f46.google.com ([209.85.221.46]) by sfi-mx-2.v28.lw.sourceforge.com with esmtps (TLS1.2:ECDHE-RSA-AES128-GCM-SHA256:128) (Exim 4.95) id 1rN9yn-0002i1-5Y for openvpn-devel@lists.sourceforge.net; Tue, 09 Jan 2024 11:09:14 +0000 Received: by mail-wr1-f46.google.com with SMTP id ffacd0b85a97d-3368ae75082so2136378f8f.1 for ; Tue, 09 Jan 2024 03:09:09 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=openvpn.net; s=google; t=1704798543; x=1705403343; darn=lists.sourceforge.net; h=user-agent:content-disposition:content-transfer-encoding :mime-version:message-id:reply-to:references:subject :list-unsubscribe:list-id:auto-submitted:cc:to:date:from:from:to:cc :subject:date:message-id:reply-to; bh=WH3WLbOEFkjbREw4J2aTshdcidMX82MYfoxjXvQrelg=; b=XxGdiGwkRyOA6TVNWtSjCSPi6yhQ4N+BoelhCjMsyf+0mG+C4IeGYKls0/MZ0vdBE5 yNNGb7/ympxoJm3BJVCfNQKXhfgJ84mgIfnuZ1v2K3i9fuabj2CpOc+l4cd6bi6dOUig Em62YVhROg2071RntbAkc5sHi50fNApRpiDRyVF3cb91dXKtgj4U5778jUS8esGExLLS WQYI0RtpWkFAjO1FplWDi5Z+SUWVJRRNxyVUNNWwdZx0hZ0qA1dvHqFdGDGeRxofRLxJ v+h1BRH6io2DmEMVj9eL9szzZXE0q8AVEWIMmI8ITCmTA/uOItJXYN89pr1htU6kIxHZ MS3A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1704798543; x=1705403343; h=user-agent:content-disposition:content-transfer-encoding :mime-version:message-id:reply-to:references:subject :list-unsubscribe:list-id:auto-submitted:cc:to:date:from :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=WH3WLbOEFkjbREw4J2aTshdcidMX82MYfoxjXvQrelg=; b=PibUfRnDuWVqa+sqQGBfEfNSTp4XTb7o3Ys5wyRaOEsR6iHlDr4Bv6hLt+a6mv4y+z AEe3+a0PplhsfbDdLBfrXQrpn3sh1+Prpo8EwjQvmrTvKrYfJ/Wz7X9u6g1LVi4xAQKy IeCPNsWgiIgBotj2CvueRalnH2wIlhkqocIQ9To+rjES1Ju+DVQludT0ANHZMSmRgDRx AEXidu6M52Gr3T2RhMEniBKrwIzCIzjLMUNVJRchmBWiljA4k2YvdHnNvi6Zh9w+BiHz 9nQ7Y505pDNQep/260QAIpiH99SbDfbFn90BPq75NjI9n23G9rGSN5qsMXwf53mC5M+Q Qghw== X-Gm-Message-State: AOJu0Yyvybp75Fkus4AYyhK0DtLQBidV77w0gnIe20jJ4ZzaDP/RqnWW iJO1LUbDLw42+RFH9A5P1wJ26JaTY3WYIQ/YsHmzfYjFj8M= X-Received: by 2002:a05:600c:314f:b0:40d:888e:34bb with SMTP id h15-20020a05600c314f00b0040d888e34bbmr314166wmo.10.1704798542797; Tue, 09 Jan 2024 03:09:02 -0800 (PST) Received: from gerrit.openvpn.in (ec2-18-159-0-78.eu-central-1.compute.amazonaws.com. [18.159.0.78]) by smtp.gmail.com with ESMTPSA id f9-20020a05600c4e8900b0040e3bdff98asm12408858wmq.23.2024.01.09.03.09.02 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 09 Jan 2024 03:09:02 -0800 (PST) From: "flichtenheld (Code Review)" X-Google-Original-From: "flichtenheld (Code Review)" X-Gerrit-PatchSet: 1 Date: Tue, 9 Jan 2024 11:09:01 +0000 To: plaisthos Auto-Submitted: auto-generated X-Gerrit-MessageType: newchange X-Gerrit-Change-Id: I8ef199463d46303129a3f563fd9eace780a58b8a X-Gerrit-Change-Number: 490 X-Gerrit-Project: openvpn X-Gerrit-ChangeURL: X-Gerrit-Commit: 878fead12bbc349b0bb53f0dcf6e8e2686b4f02d References: Message-ID: <8094f36bd4c0f3bde973bb1b4c8d206604bac081-HTML@gerrit.openvpn.net> MIME-Version: 1.0 User-Agent: Gerrit/3.8.2 X-Spam-Score: -0.2 (/) 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: Attention is currently required from: plaisthos. Hello plaisthos, I'd like you to do a code review. Please visit Content analysis details: (-0.2 points, 6.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at https://www.dnswl.org/, no trust [209.85.221.46 listed in list.dnswl.org] 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record -0.0 RCVD_IN_MSPIKE_H2 RBL: Average reputation (+2) [209.85.221.46 listed in wl.mailspike.net] -0.0 SPF_PASS SPF: sender matches SPF record 0.0 WEIRD_PORT URI: Uses non-standard port number for HTTP 0.0 HTML_MESSAGE BODY: HTML included in message -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain -0.1 DKIM_VALID_EF Message has a valid DKIM or DK signature from envelope-from domain -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.0 T_SCC_BODY_TEXT_LINE No description available. 0.0 T_KAM_HTML_FONT_INVALID Test for Invalidly Named or Formatted Colors in HTML X-Headers-End: 1rN9yn-0002i1-5Y Subject: [Openvpn-devel] [XS] Change in openvpn[master]: phase2_tcp_server: fix Coverity issue "Dereference after null check" 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: , Reply-To: frank@lichtenheld.com, arne-openvpn@rfc2549.org, openvpn-devel@lists.sourceforge.net Cc: openvpn-devel Errors-To: openvpn-devel-bounces@lists.sourceforge.net X-getmail-retrieved-from-mailbox: Inbox X-GMAIL-THRID: =?utf-8?q?1787610875502867984?= X-GMAIL-MSGID: =?utf-8?q?1787610875502867984?= X-getmail-filter-classifier: gerrit message type newchange Attention is currently required from: plaisthos. Hello plaisthos, I'd like you to do a code review. Please visit http://gerrit.openvpn.net/c/openvpn/+/490?usp=email to review the following change. Change subject: phase2_tcp_server: fix Coverity issue "Dereference after null check" ...................................................................... phase2_tcp_server: fix Coverity issue "Dereference after null check" As Coverity says: Either the check against null is unnecessary, or there may be a null pointer dereference. In phase2_tcp_server: Pointer is checked against null but then dereferenced anyway The check is probably not required since we have an ASSERT(sig_info) in the caller. But I really didn't want to remove the check. So make the code consistent instead. Change-Id: I8ef199463d46303129a3f563fd9eace780a58b8a Signed-off-by: Frank Lichtenheld --- M src/openvpn/socket.c 1 file changed, 4 insertions(+), 1 deletion(-) git pull ssh://gerrit.openvpn.net:29418/openvpn refs/changes/90/490/1 diff --git a/src/openvpn/socket.c b/src/openvpn/socket.c index 480f4e5..c158de1 100644 --- a/src/openvpn/socket.c +++ b/src/openvpn/socket.c @@ -2031,7 +2031,10 @@ false); if (!socket_defined(sock->sd)) { - register_signal(sig_info, SIGTERM, "socket-undefiled"); + if (signal_received) + { + register_signal(sig_info, SIGTERM, "socket-undefined"); + } return; } tcp_connection_established(&sock->info.lsa->actual);