Message ID | 20200409142249.20847-2-sbabic@denx.de |
---|---|
State | Accepted |
Headers | show
Return-Path: <swupdate+bncBCXPLOXJ6IKRBQW7XT2AKGQET2YS3KQ@googlegroups.com> X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=googlegroups.com (client-ip=2a00:1450:4864:20::53f; helo=mail-ed1-x53f.google.com; envelope-from=swupdate+bncbcxploxj6ikrbqw7xt2akgqet2ys3kq@googlegroups.com; receiver=<UNKNOWN>) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=denx.de Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=googlegroups.com header.i=@googlegroups.com header.a=rsa-sha256 header.s=20161025 header.b=MU350TAN; dkim-atps=neutral Received: from mail-ed1-x53f.google.com (mail-ed1-x53f.google.com [IPv6:2a00:1450:4864:20::53f]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 48yjzT3Rg3z9sSq for <incoming@patchwork.ozlabs.org>; Fri, 10 Apr 2020 00:23:00 +1000 (AEST) Received: by mail-ed1-x53f.google.com with SMTP id j10sf10188955edy.21 for <incoming@patchwork.ozlabs.org>; Thu, 09 Apr 2020 07:23:00 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1586442178; cv=pass; d=google.com; s=arc-20160816; b=KgzUbsBphQC6Nl7jVm3qoiolWdzEaH38l1u5caczbKSG3OEC8WRjOB6rH8QUe87qeR 4wNWqMygS7L3rh0d3oxH1vC7jul17TuLPdKt9MstsWH8PXG/TzlO9u2akKYxdVmiGxf9 fapJLYsdlatr77D1AFpXgHlLEabWoT5VBSsWI/Cyp/nP5Yth9lHul8LU0J9rouilTBUt /jWmszyOPfaBqq1iOobiEI3FYt99nrjwNVmbfUvTql0+WKF3vzFjxIp0ufqsmKM8eEc4 LP0l+rC4862BEX3kKnwdU1PHeAnTf5o0p9/tePG9rG3eAF10MC+4ICMBuws3rUr+6mR8 iuCg== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-unsubscribe:list-subscribe:list-archive:list-help:list-post :list-id:mailing-list:precedence:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:sender:dkim-signature; bh=btvZU/TR4a9OXg4saPifkuyLXmxSs/A/llYI8m6W8TE=; b=csd6rwP4KrS+Ng8csAR083kPax0ogBT0yTy3FcZgqW1VX8vs46gxAoEtP1t8j7qVTd 4OkTG+KQOt6LXYXwN9xYp8O1Xl2jyy6Qa7paLuoy/rIjx0/UQtpE4mlEIfB7Mma0LGI+ o6Iy78VQ+Z1U0ZtANzaijbZAW8HTxm4MKlCaShXN4MGwzULjjVgWtvRY9ISQD2xMAxGl +IlqqcZQjXds+GVjf/dFrhjX6IApzcsgNrYfEL9uF5naoi2L1Lqmz+c8OpVI99cHVvwU AOM29yH9tM2pbyDsBjZzEIRdP6AWUBG/mRZ8fI0YrROnqHWrpOJ5qPQ/K6ZjWvIJ09HW +Rkg== ARC-Authentication-Results: i=2; gmr-mx.google.com; spf=neutral (google.com: 212.18.0.9 is neither permitted nor denied by best guess record for domain of sbabic@denx.de) smtp.mailfrom=sbabic@denx.de DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlegroups.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:x-original-sender:x-original-authentication-results :precedence:mailing-list:list-id:list-post:list-help:list-archive :list-subscribe:list-unsubscribe; bh=btvZU/TR4a9OXg4saPifkuyLXmxSs/A/llYI8m6W8TE=; b=MU350TANNUciztoRTyuQU1JOR5xscyqpiCkn/YM8k0dPSbRFT61iscpfTucAw/fztW wf+b/FpZ2UTPfp210WSB8zFAkH4pUSJaRY6T7Ama69NP2f63WDlAG3sSZagu3gj0AY06 lHetqNAuZEeQnUIhO2ag0Ici6jiub1XAXffJ6NuFJG/KwtEPSAhGjR7D0NdnHAyyV42f AAohWdOxjrnA5vzC6GFIeItz87QPM0MAZ3PtnSSiGGnJbPOAlpD24i1nrn/wWrF7eljE GefJXmmvETX7YgAjQjEJCB7gIdFr13L8w5/mDvRWJBnUa4B2Cy7ukA/Bf/4uwadqU2RS 6K8w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=sender:x-gm-message-state:from:to:cc:subject:date:message-id :in-reply-to:references:mime-version:x-original-sender :x-original-authentication-results:precedence:mailing-list:list-id :x-spam-checked-in-group:list-post:list-help:list-archive :list-subscribe:list-unsubscribe; bh=btvZU/TR4a9OXg4saPifkuyLXmxSs/A/llYI8m6W8TE=; b=X5FsVkAgqm+9pxRhZciXMSaCHo8oU5sGkYQrMJU4x6fKAu2JLytd2G935qMJ5CwPdn g+Bo0C6GJFSDeBS2ZRV3CZDZ9bncMV01yqq3CB9dcqMpimRdremCevBOapvQgLfW4Ph/ 2SVXMlzYVGmw4LArvtcpzDNW+rQO8GU3Xr96+cHtdQYFd3B6H8WpV1QmnOlIiIZptq1B 7DLh/mxbNp/hm9KuT6yls+2/EUnFyTz6USdyRYqn76RYm6asp0wZT40g3h08dg4GIApL ZG31z03CX4qLYxbsob0rBoiLjk4erAMArqNxneNvBWB/KcmzYW2rO1IpjT7qw0W4SOqT +haA== Sender: swupdate@googlegroups.com X-Gm-Message-State: AGi0Puao3EEJ/LWHHqHaADXbUrahxJzrRVfnEq+r7R1uehnQ3zHMiY70 E2vfWvtOS34sAaOYgYexoAs= X-Google-Smtp-Source: APiQypJk+llj0a4tZiryalXh28pA1OpQgwg74bEf5oof36Tko31cLXZXoYolqYdI8MtwScudWGzlPA== X-Received: by 2002:a50:ed19:: with SMTP id j25mr244138eds.264.1586442178310; Thu, 09 Apr 2020 07:22:58 -0700 (PDT) X-BeenThere: swupdate@googlegroups.com Received: by 2002:a17:906:1b4a:: with SMTP id p10ls4066354ejg.9.gmail; Thu, 09 Apr 2020 07:22:57 -0700 (PDT) X-Received: by 2002:a17:906:d9cf:: with SMTP id qk15mr2576744ejb.55.1586442177657; Thu, 09 Apr 2020 07:22:57 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1586442177; cv=none; d=google.com; s=arc-20160816; b=J6Z0tHeONKtdB6bpPD98zpg+YqSF57wt/gqvI3oRkGF+2emOAT3Jmr4PjvqmC4eSLg cYlA+klt5fFK+BAUUd/0PgEZvWunHwhjJhY6Twu/8tMAuHhlPYUqXOBwU74aYgM9xvsr n5odHBVchwUxeU90gNIUKAYZumCaLs3+1BtlXCM6nrl5G/vPrXk3asKvKiVdmftSyhNO AqSD6arIvj+H2pnR0NY64yt6cYarzgSp2KIldyVPNaYyTEDJmbDxY+m0VL28ivgKfYk0 CiQ8skMN8I8avK5E3VBTfBPXGJY7EtX+JXiLK/iGY0nnUNPkrq4F5h+f9uW0VdOJ1/rr oqFg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from; bh=6pY9GF+Vm3yEjUeuwNn30IN4AEEeYsympl+sZEzQUWI=; b=L2Q6hB+h3VDUZFjGPz/ZTGQIDWH9LDDb7tXt5gCqli30lQbc34G7cxCQmqX/hNgfTz 4fXliWtvA71wqBIkqi79lpMoBlWkhfOjsmFL9w8SKGPTFQfE/OLDpi0hAs/D4Pypg96I UTeFDW1h0RfdgKYN31u4rQRfR12lrjFXyzGi3sXC0gNR77ZDmtaHjsV8fQrfiKJCLtA6 /TOrIyc2cuYerunM1gnvXQcObthLm+hv5ENe37/xABV9p4lh5Ck+vgKZvPyU05Rfcbob PPatqQ3vN3sQorJgQ49sGYcEaH/5Df9VBOqOAJwGV0OViB8TKl+EkbFGPSczmMilnnoV C9Ww== ARC-Authentication-Results: i=1; gmr-mx.google.com; spf=neutral (google.com: 212.18.0.9 is neither permitted nor denied by best guess record for domain of sbabic@denx.de) smtp.mailfrom=sbabic@denx.de Received: from mail-out.m-online.net (mail-out.m-online.net. [212.18.0.9]) by gmr-mx.google.com with ESMTPS id a10si606639edq.5.2020.04.09.07.22.57 for <swupdate@googlegroups.com> (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Thu, 09 Apr 2020 07:22:57 -0700 (PDT) Received-SPF: neutral (google.com: 212.18.0.9 is neither permitted nor denied by best guess record for domain of sbabic@denx.de) client-ip=212.18.0.9; Received: from frontend01.mail.m-online.net (unknown [192.168.8.182]) by mail-out.m-online.net (Postfix) with ESMTP id 48yjzP35k9z1qsbG; Thu, 9 Apr 2020 16:22:57 +0200 (CEST) Received: from localhost (dynscan1.mnet-online.de [192.168.6.70]) by mail.m-online.net (Postfix) with ESMTP id 48yjzP2tr9z1qv4G; Thu, 9 Apr 2020 16:22:57 +0200 (CEST) X-Virus-Scanned: amavisd-new at mnet-online.de Received: from mail.mnet-online.de ([192.168.8.182]) by localhost (dynscan1.mail.m-online.net [192.168.6.70]) (amavisd-new, port 10024) with ESMTP id bd9K2ASsKhY4; Thu, 9 Apr 2020 16:22:55 +0200 (CEST) Received: from babic.homelinux.org (host-88-217-136-221.customer.m-online.net [88.217.136.221]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.mnet-online.de (Postfix) with ESMTPS; Thu, 9 Apr 2020 16:22:55 +0200 (CEST) Received: from localhost (mail.babic.homelinux.org [127.0.0.1]) by babic.homelinux.org (Postfix) with ESMTP id E6C584540297; Thu, 9 Apr 2020 16:22:55 +0200 (CEST) X-Virus-Scanned: Debian amavisd-new at babic.homelinux.org Received: from babic.homelinux.org ([127.0.0.1]) by localhost (mail.babic.homelinux.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 0KynASlaYWfg; Thu, 9 Apr 2020 16:22:51 +0200 (CEST) Received: from paperino.fritz.box (paperino.fritz.box [192.168.178.38]) by babic.homelinux.org (Postfix) with ESMTP id D54014540542; Thu, 9 Apr 2020 16:22:51 +0200 (CEST) From: Stefano Babic <sbabic@denx.de> To: swupdate@googlegroups.com Cc: Stefano Babic <sbabic@denx.de> Subject: [swupdate] [PATCH] Fix coverity #292154 Date: Thu, 9 Apr 2020 16:22:48 +0200 Message-Id: <20200409142249.20847-2-sbabic@denx.de> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20200409142249.20847-1-sbabic@denx.de> References: <20200409142249.20847-1-sbabic@denx.de> MIME-Version: 1.0 X-Original-Sender: sbabic@denx.de X-Original-Authentication-Results: gmr-mx.google.com; spf=neutral (google.com: 212.18.0.9 is neither permitted nor denied by best guess record for domain of sbabic@denx.de) smtp.mailfrom=sbabic@denx.de Content-Type: text/plain; charset="UTF-8" Precedence: list Mailing-list: list swupdate@googlegroups.com; contact swupdate+owners@googlegroups.com List-ID: <swupdate.googlegroups.com> X-Spam-Checked-In-Group: swupdate@googlegroups.com X-Google-Group-Id: 605343134186 List-Post: <https://groups.google.com/group/swupdate/post>, <mailto:swupdate@googlegroups.com> List-Help: <https://groups.google.com/support/>, <mailto:swupdate+help@googlegroups.com> List-Archive: <https://groups.google.com/group/swupdate List-Subscribe: <https://groups.google.com/group/swupdate/subscribe>, <mailto:swupdate+subscribe@googlegroups.com> List-Unsubscribe: <mailto:googlegroups-manage+605343134186+unsubscribe@googlegroups.com>, <https://groups.google.com/group/swupdate/subscribe> |
Series |
Fix coverity #292154
|
expand
|
diff --git a/core/cpio_utils.c b/core/cpio_utils.c index 285c00c..9fe25a6 100644 --- a/core/cpio_utils.c +++ b/core/cpio_utils.c @@ -112,7 +112,12 @@ void extract_padding(int fd, unsigned long *offset) int copy_write(void *out, const void *buf, unsigned int len) { int ret; - int fd = (out != NULL) ? *(int *)out : -1; + int fd; + + if (!out) + return -1; + + fd = *(int *)out; while (len) { errno = 0;
Signed-off-by: Stefano Babic <sbabic@denx.de> --- core/cpio_utils.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-)