From nobody Wed Nov 5 16:36:24 2025 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=oracle.com Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 1535644304811538.6341016670807; Thu, 30 Aug 2018 08:51:44 -0700 (PDT) Received: from localhost ([::1]:49579 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fvPEV-0008DI-Lq for importer@patchew.org; Thu, 30 Aug 2018 11:51:43 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:54700) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fvPCN-0006mW-40 for qemu-devel@nongnu.org; Thu, 30 Aug 2018 11:49:31 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fvP8a-0005Zb-5O for qemu-devel@nongnu.org; Thu, 30 Aug 2018 11:45:39 -0400 Received: from aserp2120.oracle.com ([141.146.126.78]:44696) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1fvP8Z-0005Wl-T1 for qemu-devel@nongnu.org; Thu, 30 Aug 2018 11:45:36 -0400 Received: from pps.filterd (aserp2120.oracle.com [127.0.0.1]) by aserp2120.oracle.com (8.16.0.22/8.16.0.22) with SMTP id w7UFdGcV030752 for ; Thu, 30 Aug 2018 15:45:35 GMT Received: from aserv0021.oracle.com (aserv0021.oracle.com [141.146.126.233]) by aserp2120.oracle.com with ESMTP id 2m2y2pwhj4-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK) for ; Thu, 30 Aug 2018 15:45:35 +0000 Received: from userv0122.oracle.com (userv0122.oracle.com [156.151.31.75]) by aserv0021.oracle.com (8.14.4/8.14.4) with ESMTP id w7UFjY3s014142 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK) for ; Thu, 30 Aug 2018 15:45:34 GMT Received: from abhmp0014.oracle.com (abhmp0014.oracle.com [141.146.116.20]) by userv0122.oracle.com (8.14.4/8.14.4) with ESMTP id w7UFjYmU007767 for ; Thu, 30 Aug 2018 15:45:34 GMT Received: from ol7.uk.oracle.com (/10.175.215.81) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Thu, 30 Aug 2018 08:45:33 -0700 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=from : to : subject : date : message-id : in-reply-to : references; s=corp-2018-07-02; bh=SJlakGcyh1isXxPK32Wq6iy3spKyo/ITMcBBwJY1kEw=; b=Tk8L2nSZ2O3MwudVcI03F2Zn3e8yQ9EWwMkQ4522nhmtIldu7R3LK8HKlx2wZ4Mz6a8a CutM10Lv7HnTQjrlGpzNS8l3QeutuBa6YvmdYFYtpBmLvwHgi9vL35U9nG0+DYCJ2IDu vb8FBDsvbsD4o1/PsPxixjl8+L8oovMHtvZF4QuPJ5Vora8HuR9Hn0rVzuo5liDb6vfp IdCOShc2tuv71pLSRJfyzdioSs58CkjQ0gP1FvKK0e5AGM0Hnf3CiNv+HusoEVyV3qLR i6G3yy4/o3mdtEECFuJ8v72r2x1yMJkWnYdjl9pYJKY73iPCd+3j4P+ZiWaQDQsfpzT0 yg== From: Liam Merwick To: qemu-devel@nongnu.org Date: Thu, 30 Aug 2018 16:47:10 +0100 Message-Id: <1535644031-848-8-git-send-email-Liam.Merwick@oracle.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1535644031-848-1-git-send-email-Liam.Merwick@oracle.com> References: <1535644031-848-1-git-send-email-Liam.Merwick@oracle.com> X-Proofpoint-Virus-Version: vendor=nai engine=5900 definitions=9000 signatures=668708 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 suspectscore=1 malwarescore=0 phishscore=0 bulkscore=0 spamscore=0 mlxscore=0 mlxlogscore=759 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1807170000 definitions=main-1808300162 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x [generic] X-Received-From: 141.146.126.78 Subject: [Qemu-devel] [PATCH 7/8] io: file descriptor not initialized in qio_channel_command_new_spawn() X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZohoMail: RDMRC_1 RDKM_2 RSF_0 Z_629925259 SPT_0 Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Incorrect checking of flags could result in uninitialized file descriptor being used. Signed-off-by: Liam Merwick Reviewed-by: Darren Kenny Reviewed-by: Mark Kanda --- io/channel-command.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/io/channel-command.c b/io/channel-command.c index 3e7eb17eff54..38deb687da21 100644 --- a/io/channel-command.c +++ b/io/channel-command.c @@ -59,10 +59,10 @@ qio_channel_command_new_spawn(const char *const argv[], =20 flags =3D flags & O_ACCMODE; =20 - if (flags =3D=3D O_RDONLY) { + if ((flags & O_RDONLY) =3D=3D O_RDONLY) { stdinnull =3D true; } - if (flags =3D=3D O_WRONLY) { + if ((flags & O_WRONLY) =3D=3D O_WRONLY) { stdoutnull =3D true; } =20 --=20 1.8.3.1