Message ID | 1535733414-6812-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 EB28917DE for <patchwork-qemu-devel@patchwork.kernel.org>; Fri, 31 Aug 2018 16:40:01 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id D953F2B5E8 for <patchwork-qemu-devel@patchwork.kernel.org>; Fri, 31 Aug 2018 16:40:01 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id CE0272B68A; Fri, 31 Aug 2018 16:40:01 +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 85BA92B61C for <patchwork-qemu-devel@patchwork.kernel.org>; Fri, 31 Aug 2018 16:40:01 +0000 (UTC) Received: from localhost ([::1]:55004 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 1fvmSm-0006HG-Fi for patchwork-qemu-devel@patchwork.kernel.org; Fri, 31 Aug 2018 12:40:00 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:40766) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from <Liam.Merwick@oracle.com>) id 1fvmOO-0000zc-Kk for qemu-devel@nongnu.org; Fri, 31 Aug 2018 12:35:29 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from <Liam.Merwick@oracle.com>) id 1fvmOH-00058A-FT for qemu-devel@nongnu.org; Fri, 31 Aug 2018 12:35:27 -0400 Received: from userp2120.oracle.com ([156.151.31.85]:39694) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from <Liam.Merwick@oracle.com>) id 1fvmOF-00052Q-W8 for qemu-devel@nongnu.org; Fri, 31 Aug 2018 12:35:20 -0400 Received: from pps.filterd (userp2120.oracle.com [127.0.0.1]) by userp2120.oracle.com (8.16.0.22/8.16.0.22) with SMTP id w7VGYvS5140642 for <qemu-devel@nongnu.org>; Fri, 31 Aug 2018 16:35:13 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=YpDNye/ABNrlACAB3HlEHKC6HMEkMsL5R4F3/7AHdaVMhfoiGAH+4iTg0qadRebgN+2u NF+g2OgAog8tBlAQ0QK/qBpLjr1TwEFlgXRwtfg4iQuNUANyMWjoXqzypLDQgIQHsrhq /HmrKp7A26/9oVxBdmBqtkCD80jgJyWGqT0GLh6FWFuVwY+RfgKf8PDIDkIVHr8qlXO9 BbxF2S+ijVubreaMpzAny0DaX6cKsWwLxLlDF0Attox9qzEhX/Uun7dEzubN+DCWh5Ca uqTEPiLznHTlz8xfTMVrMDVKmbuAgTOQ1HvcZq+GnhAcsiud6+5oZN6ds4cbvJ2V91+c SA== Received: from aserv0021.oracle.com (aserv0021.oracle.com [141.146.126.233]) by userp2120.oracle.com with ESMTP id 2m2yrqvb8t-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK) for <qemu-devel@nongnu.org>; Fri, 31 Aug 2018 16:35:13 +0000 Received: from aserv0122.oracle.com (aserv0122.oracle.com [141.146.126.236]) by aserv0021.oracle.com (8.14.4/8.14.4) with ESMTP id w7VGZCO9019935 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK) for <qemu-devel@nongnu.org>; Fri, 31 Aug 2018 16:35:12 GMT Received: from abhmp0001.oracle.com (abhmp0001.oracle.com [141.146.116.7]) by aserv0122.oracle.com (8.14.4/8.14.4) with ESMTP id w7VGZCIv024282 for <qemu-devel@nongnu.org>; Fri, 31 Aug 2018 16:35:12 GMT Received: from ol7.nl.oracle.com (/10.175.61.138) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Fri, 31 Aug 2018 09:35:12 -0700 From: Liam Merwick <Liam.Merwick@oracle.com> To: qemu-devel@nongnu.org Date: Fri, 31 Aug 2018 17:36:50 +0100 Message-Id: <1535733414-6812-5-git-send-email-Liam.Merwick@oracle.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1535733414-6812-1-git-send-email-Liam.Merwick@oracle.com> References: <1535733414-6812-1-git-send-email-Liam.Merwick@oracle.com> X-Proofpoint-Virus-Version: vendor=nai engine=5900 definitions=9001 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=794 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1807170000 definitions=main-1808310170 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x [generic] X-Received-From: 156.151.31.85 Subject: [Qemu-devel] [PATCH v2 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;