Message ID | 1535644031-848-5-git-send-email-Liam.Merwick@oracle.com (mailing list archive) |
---|---|
State | New, archived |
Headers | show
Return-Path: <qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org> Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 6F95414BD for <patchwork-qemu-devel@patchwork.kernel.org>; Thu, 30 Aug 2018 15:57:16 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 5FBD52C0EA for <patchwork-qemu-devel@patchwork.kernel.org>; Thu, 30 Aug 2018 15:57:16 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 52A222C0EC; Thu, 30 Aug 2018 15:57:16 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.8 required=2.0 tests=BAYES_00,DKIM_SIGNED, MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI,T_DKIM_INVALID,UNPARSEABLE_RELAY autolearn=ham version=3.3.1 Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 003DD2C0EA for <patchwork-qemu-devel@patchwork.kernel.org>; Thu, 30 Aug 2018 15:57:15 +0000 (UTC) Received: from localhost ([::1]:49618 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from <qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org>) id 1fvPJr-00074C-7n for patchwork-qemu-devel@patchwork.kernel.org; Thu, 30 Aug 2018 11:57:15 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:53877) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from <Liam.Merwick@oracle.com>) id 1fvPCK-0006Y2-L6 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 <Liam.Merwick@oracle.com>) id 1fvP8a-0005a5-8T for qemu-devel@nongnu.org; Thu, 30 Aug 2018 11:45:39 -0400 Received: from userp2130.oracle.com ([156.151.31.86]:53802) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from <Liam.Merwick@oracle.com>) id 1fvP8Z-0005Ql-Th for qemu-devel@nongnu.org; Thu, 30 Aug 2018 11:45:36 -0400 Received: from pps.filterd (userp2130.oracle.com [127.0.0.1]) by userp2130.oracle.com (8.16.0.22/8.16.0.22) with SMTP id w7UFdGS1000796 for <qemu-devel@nongnu.org>; Thu, 30 Aug 2018 15:45:33 GMT 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=d57m5px3UpkBjMYNbdfrJ5lORtZvHO6efeRyL6punSc=; b=ZOR9xe0TSX+hxuR4gTu4219eVYcAktGhte64RIWzgDPcQ/a/wQH9j0DrGIZC8qEnNb/d kS5rM26dcR0M0iFGM112IsoOlzh1Kj9TfQnspNM5HVII07Tb4Rqxk2ZoGe51GSGSN5wB su8Lm+efT5zvQ2RNs2ykC5d+GMX6FvZwpXHIg1xSmfpjtacp5f4z6Flo8RV2pVhuq8Ce +VtLDhpf9JiMAQp1vRcIZxQznuo5/wLJwVrRF1hNuC3K/+gSo7t33Ijic8PbhVa4vhDf jxENLQIGiTLW+off8aJ3knTlK63aMEGwNeVo8Cm0Sxh9kXoU8WOxiK2WlVub8UTmfq+2 XQ== Received: from aserv0021.oracle.com (aserv0021.oracle.com [141.146.126.233]) by userp2130.oracle.com with ESMTP id 2m2xhu5j54-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK) for <qemu-devel@nongnu.org>; Thu, 30 Aug 2018 15:45:33 +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 w7UFjWhi014055 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK) for <qemu-devel@nongnu.org>; Thu, 30 Aug 2018 15:45:32 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 w7UFjV9e007750 for <qemu-devel@nongnu.org>; Thu, 30 Aug 2018 15:45:32 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:31 -0700 From: Liam Merwick <Liam.Merwick@oracle.com> To: qemu-devel@nongnu.org Date: Thu, 30 Aug 2018 16:47:07 +0100 Message-Id: <1535644031-848-5-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=792 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: 156.151.31.86 Subject: [Qemu-devel] [PATCH 4/8] qemu-img: potential Null pointer deref in img_commit() X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: <qemu-devel.nongnu.org> List-Unsubscribe: <https://lists.nongnu.org/mailman/options/qemu-devel>, <mailto:qemu-devel-request@nongnu.org?subject=unsubscribe> List-Archive: <http://lists.nongnu.org/archive/html/qemu-devel/> List-Post: <mailto:qemu-devel@nongnu.org> List-Help: <mailto:qemu-devel-request@nongnu.org?subject=help> List-Subscribe: <https://lists.nongnu.org/mailman/listinfo/qemu-devel>, <mailto:qemu-devel-request@nongnu.org?subject=subscribe> Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" <qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org> X-Virus-Scanned: ClamAV using ClamSMTP |
Series |
off-by-one and NULL pointer accesses detected by static analysis
|
expand
|
diff --git a/qemu-img.c b/qemu-img.c index b12f4cd19b0a..51fe09bd08ed 100644 --- a/qemu-img.c +++ b/qemu-img.c @@ -1029,6 +1029,9 @@ static int img_commit(int argc, char **argv) } job = block_job_get("commit"); + if (job == NULL) { + goto unref_backing; + } run_block_job(job, &local_err); if (local_err) { goto unref_backing;