From patchwork Wed Feb 19 14:56:43 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Selva Nair X-Patchwork-Id: 1014 Return-Path: Delivered-To: patchwork@openvpn.net Delivered-To: patchwork@openvpn.net Received: from director11.mail.ord1d.rsapps.net ([172.27.255.7]) by backend30.mail.ord1d.rsapps.net with LMTP id SHkgMqXnTV7tKwAAIUCqbw for ; Wed, 19 Feb 2020 20:57:57 -0500 Received: from proxy17.mail.iad3a.rsapps.net ([172.27.255.7]) by director11.mail.ord1d.rsapps.net with LMTP id 2Jl8L6XnTV7QNAAAvGGmqA ; Wed, 19 Feb 2020 20:57:57 -0500 Received: from smtp5.gate.iad3a ([172.27.255.7]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) by proxy17.mail.iad3a.rsapps.net with LMTP id SLyzKaXnTV4bCQAAR4KW9A ; Wed, 19 Feb 2020 20:57:57 -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: smtp5.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 (signature verification failed) header.d=gmail.com; dmarc=fail (p=none; dis=none) header.from=gmail.com X-Suspicious-Flag: YES X-Classification-ID: 69fb5fea-5384-11ea-9763-525400de824c-1-1 Received: from [216.105.38.7] ([216.105.38.7:57228] helo=lists.sourceforge.net) by smtp5.gate.iad3a.rsapps.net (envelope-from ) (ecelerity 4.2.38.62370 r(:)) with ESMTPS (cipher=DHE-RSA-AES256-GCM-SHA384) id 3F/9A-01963-5A7ED4E5; Wed, 19 Feb 2020 20:57:57 -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.90_1) (envelope-from ) id 1j4b5O-00047k-SK; Thu, 20 Feb 2020 01:57:06 +0000 Received: from [172.30.20.202] (helo=mx.sourceforge.net) by sfs-ml-1.v29.lw.sourceforge.com with esmtps (TLSv1.2:ECDHE-RSA-AES256-GCM-SHA384:256) (Exim 4.90_1) (envelope-from ) id 1j4b5O-00047c-Cn for openvpn-devel@lists.sourceforge.net; Thu, 20 Feb 2020 01:57:06 +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: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=qCNXZ4hkvj5PXQkXGGuMfajU3RtMBJxUuoi4Z/h4WkI=; b=euGIjPGXbPNAXNMbTjpr2sVUH2 Pfw7LYMCgofEbbkuTD7b0MeQL2iVeGI3E6ii3ISdGxY3sQtNGq9ueKVPgAEZlX5hznhizwYtpJ5JK ZlT5GDoKPgZYKEcHZg7vpDpkbv0QtN51AzlBiMF7/BzPXoTcdCwHMiuMjGulx/pve8zc=; 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: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=qCNXZ4hkvj5PXQkXGGuMfajU3RtMBJxUuoi4Z/h4WkI=; b=h eDzRmUGaBfMmQ8K4zz5c6lu0WsAULy8W1rfLjZDRQD5xnO+tfRQDHE9MYMsuxwgNadj3DBiigPa9O UdH1sESrwS7/E6/DwLCG78lRG+h+2ErxIyOGCWOP73NqmoPzWB0+8Ff7QlUbX6pQXAf/AoAanQ/Ao smfme70Lw+JbJg1c=; Received: from mail-qt1-f196.google.com ([209.85.160.196]) by sfi-mx-1.v28.lw.sourceforge.com with esmtps (TLSv1.2:ECDHE-RSA-AES128-GCM-SHA256:128) (Exim 4.92.2) id 1j4b5M-000RTj-I4 for openvpn-devel@lists.sourceforge.net; Thu, 20 Feb 2020 01:57:06 +0000 Received: by mail-qt1-f196.google.com with SMTP id l16so1818125qtq.1 for ; Wed, 19 Feb 2020 17:57:04 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=qCNXZ4hkvj5PXQkXGGuMfajU3RtMBJxUuoi4Z/h4WkI=; b=d3UbeO9GZ5DRNq2WESZaLJVZaT/A7TL7s8AbaQi9NaUYc+fZVbqMgd0C9pkdZQT3lo Gu+ZwAbvwh7687mqcS7wMzMwv+hMIRX7k7AeklUfLk4CqBHtR35G2eUJ3Bf5qt0z3dVG EwTsL0ayvsIYCBNQt5p7rH3RBXlY1REwJaL1uIJAGyw1NR4dXxW8WnhSiSz01yVRirD+ Fw6+TzqDLfMaz8WoiRbcBVQfA8IrMvY4AYSMBYxY9kFN2HAsSNsppWCk9EsqDQdWXtb3 BqmnaoRL3mhY7lJ4yHYTiLGmjwJ4PzeCF4P0UZrc4gswk9CkBsEL3s/z70Gbb+moDCdK VNSQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=qCNXZ4hkvj5PXQkXGGuMfajU3RtMBJxUuoi4Z/h4WkI=; b=stjVB10z0xtgyqhnM3b/PrrpSfDxkVDE0lOD2BcXUr7BrjBv2b35Z1xu2QPbdKDAmN OOC9icZqkaumh/le9mPgB/JhnCvDTsmAZPt0Elbcu1MlurhOtpNfLNqY3hmRN5QFyRsd QrzoPwaGzMF/JxlGO03U1eAPsGPIFy3WqtJ/OEGqRzcI/p7FRBSVUF3wt9wtjiPecf2M 0OzmIuNG0pCqVp7fZqKLUP8j4d6e/chkbXFBHorFqq5kigCh3lvuL7CF+GmIWGatJvau kpKwtHGrE/+GC7oiDRE9+Lns9ubHwyK8pRX9KurMJFIp4dh/bWiMMttVjekqcEc+6uEC 6pLw== X-Gm-Message-State: APjAAAXoBOnGb7lBz2xh37Ww51UHjHbeFxfnYX/1j4diqbaRS5KuqAxU b1ILHXmzORm65qFB4C3XabRW4QcEwNc= X-Google-Smtp-Source: APXvYqx34gf+JaWVWQ12y+9SeGBnID5f3hRDdGPn3WOx/5DzeAN3Lxb1FaghfEysEa1F0/30pwJjLg== X-Received: by 2002:aed:3324:: with SMTP id u33mr23961614qtd.322.1582163815027; Wed, 19 Feb 2020 17:56:55 -0800 (PST) Received: from saturn.home.sansel.ca (CPE40167ea0e1c2-CM788df74daaa0.cpe.net.cable.rogers.com. [99.228.216.21]) by smtp.gmail.com with ESMTPSA id p50sm1110110qtf.5.2020.02.19.17.56.54 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 19 Feb 2020 17:56:54 -0800 (PST) From: selva.nair@gmail.com To: openvpn-devel@lists.sourceforge.net Date: Wed, 19 Feb 2020 20:56:43 -0500 Message-Id: <1582163803-3342-1-git-send-email-selva.nair@gmail.com> X-Mailer: git-send-email 2.1.4 MIME-Version: 1.0 X-Spam-Report: Spam Filtering performed by mx.sourceforge.net. See http://spamassassin.org/tag/ for more details. 0.0 FREEMAIL_FROM Sender email is commonly abused enduser mail provider (selva.nair[at]gmail.com) -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at https://www.dnswl.org/, no trust [209.85.160.196 listed in list.dnswl.org] 0.0 RCVD_IN_MSPIKE_H3 RBL: Good reputation (+3) [209.85.160.196 listed in wl.mailspike.net] -0.0 SPF_PASS SPF: sender matches SPF record 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's 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 RCVD_IN_MSPIKE_WL Mailspike good senders -0.0 AWL AWL: Adjusted score from AWL reputation of From: address X-Headers-End: 1j4b5M-000RTj-I4 Subject: [Openvpn-devel] [PATCH] Fix possible access of uninitialized pipe handles 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 From: Selva Nair Compile time warning for openvpnserv.exe interactive.c: In function ‘RunOpenvpn’: interactive.c:160:27: warning: ‘svc_pipe’ may be used uninitialized in this function [-Wmaybe-uninitialized] When RunOpenvpn exits early due to errors, uninitialized svc_pipe and ovpn_pipe vars could get passed to CloseHandleEx(). Fix by initializing to NULL. Signed-off-by: Selva Nair Acked-by: Lev Stipakov --- src/openvpnserv/interactive.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/openvpnserv/interactive.c b/src/openvpnserv/interactive.c index 710f9c7..8da49be 100644 --- a/src/openvpnserv/interactive.c +++ b/src/openvpnserv/interactive.c @@ -1468,7 +1468,7 @@ static DWORD WINAPI RunOpenvpn(LPVOID p) { HANDLE pipe = p; - HANDLE ovpn_pipe, svc_pipe; + HANDLE ovpn_pipe = NULL, svc_pipe = NULL; PTOKEN_USER svc_user = NULL, ovpn_user = NULL; HANDLE svc_token = NULL, imp_token = NULL, pri_token = NULL; HANDLE stdin_read = NULL, stdin_write = NULL;