From patchwork Mon May 4 21:32:59 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stefano Babic X-Patchwork-Id: 1283033 Return-Path: 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::43b; helo=mail-wr1-x43b.google.com; envelope-from=swupdate+bncbcxploxj6ikrbeuuyl2qkgqez2njorq@googlegroups.com; receiver=) 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=f+nN/83c; dkim-atps=neutral Received: from mail-wr1-x43b.google.com (mail-wr1-x43b.google.com [IPv6:2a00:1450:4864:20::43b]) (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 49GGLG5pYbz9sSc for ; Tue, 5 May 2020 07:33:09 +1000 (AEST) Received: by mail-wr1-x43b.google.com with SMTP id p8sf18381wrj.5 for ; Mon, 04 May 2020 14:33:09 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1588627986; cv=pass; d=google.com; s=arc-20160816; b=Mnl4kDAOdeSBhq65inmr3Ep8I3BsslcvEuGksuOSd7zhVpNXQQm0DebHKoo8Ceb7u9 dSQl0vQHhc+4Ko78xofC217Ys5Bmzd9J6I0bAEgAd1BS+MyIuPP7PMOfm6lh3rCdYg/+ +luxQka2qKOUZ+V2r2MwgDtj74EN2a50DswmDHImWBzwPhHqZKoMLBlYMyrC+vjGxYpW lUT10mLbvDEoeg+3RmJ6zj91IG3ajmGDXXB6LvIu4KAlnQQ8eiBGqj/eUaDLz9Tv5ej1 rpm5jACAMvBZ6vbMC4Rusl9q8z7Ci6xA96D5p3kXmtsE9j7528Ha/Wm2EV+izLJF9sBk mkCA== 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=bfJh+Sif69VwqiaRYAb+NTjd7KoHt4s82kN5QAkRskM=; b=azhRx1Q5vOhx47rJ9dQo5+/h4ZIb5amr0GBRzk1M84Vr1x8OObxmORFNCdLe6U7AXi z14lZSlb90jyKOwuI7TcsHv0VF4hTSIbINVg1V8A+pKHffYxjd1wH2S2TGYjuDNxD6W8 WZyM8ieOOvH93qJaMCfc8C+X5VtpyzBeZko39zJIxO8s+tDcr0AzBT9iT4ZCOyIyASAA WH40cmFfL6BoxzFb+mfhQPuoI/j6iWMTf1C8c3TwJzgDUu4o7hN4jxXb1Zo19G9Eq0+H UV7a9+n7f885CPEwWau6d0nsurECaNC6xDu2xGVYGWBeELPjn1JB9xJ2Hsqfnajmp5WS FaHw== ARC-Authentication-Results: i=2; gmr-mx.google.com; spf=neutral (google.com: 212.18.0.10 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=bfJh+Sif69VwqiaRYAb+NTjd7KoHt4s82kN5QAkRskM=; b=f+nN/83ckGtv0+4guYCLiIyoEJZc6eyCgTtAYoRurJWiiVHyooj+Zq5Bz9WXvWmLB2 iqBjOICD9/YiBbGaEPj10LqWzbFZ+MMhFrf1olCPkWsE3MiR4vMtH+cSsECW+hpBkqsT l232jQ4+0pLdr1MeBKXrej8ZknTWPVYd28tRj2cvRKOqQXPMpw1eR2+elxzmujXm387x iWKvP7poXirzbYYaAL4wFI0VREHxfz9mmFzVm+k3JJ79iVbrq2Qmdz0QLLNETpkFFEn3 jJbwk2UQb15ezW4ujAoT5VvzMg5t55HFU7v+iZhA1594Z71fq/w5xxa0aLm00YswGL52 VqVQ== 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=bfJh+Sif69VwqiaRYAb+NTjd7KoHt4s82kN5QAkRskM=; b=nXoHFE7CVjtc6a466nlJZps725rhf3POiHLthQ/0BH12rFMuXe74KcnSTAr6zdeGmK HCiV+l97O7om8h2p8uv4fdRY/V7YrumHlnUm5xl3hNEuWEXV9CDR7PHpFHccvuQFvLEa 453gz60RmrwQNfTfVsCxRB05w17cjgcLxd2BwNwaHwiITeSvO3rO1YZofm/fLTJF/Gue NHBGAtxioM7UdyUiqir0gkP30BwHrwh5uE0iv1K0cD+o9vzbhWWvrplQdqR58Fzvl4JA B8w8beKb5kBLwED7sZA9F7b/vo8GVFb3FJI0lkR5gqBmDcHuX/MKetdnC7bQXouAangB Ahyw== Sender: swupdate@googlegroups.com X-Gm-Message-State: AGi0Puak7U1TL457X7rFXQgtaiOqYcC94DBh3Vw5/zP5fAOQSu5pNHEm LW8PW5DXN4hntaeSh4weQak= X-Google-Smtp-Source: APiQypJQxWZyHgwmYjSKCSySIU4z8SMBvigg6EndeDgYqch/Fr/EMz/fHCRUywGPtWlox+/5mn1RIQ== X-Received: by 2002:adf:d0ce:: with SMTP id z14mr1228884wrh.179.1588627986392; Mon, 04 May 2020 14:33:06 -0700 (PDT) X-BeenThere: swupdate@googlegroups.com Received: by 2002:a1c:7d12:: with SMTP id y18ls136925wmc.2.gmail; Mon, 04 May 2020 14:33:05 -0700 (PDT) X-Received: by 2002:a05:600c:2945:: with SMTP id n5mr16654371wmd.148.1588627985664; Mon, 04 May 2020 14:33:05 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1588627985; cv=none; d=google.com; s=arc-20160816; b=oLC/BWEOYWJHsSddxikmoXnUMkE0dMsODlKJeyG+AC1mxcIdMxVc7DtQAFZ2YDOyTp Xz3AkIg47u5k1hZWjTIXyytBzUWD1a5WQOAoTngnupsW4iyUo0LILyvH7oW1/PfIKWG7 G5YNv1f7jjPOR2phqutE32k5u/ch+GTu0v23MJGFIXHcyaKVfzGNVtoXcGlC3EURzdC5 xkf+RUJTt60FNtdwjDlgX5a/VN07bQbs49E0AdRSE+foUcUHd9L4pPs2Hgj3291J9mDM nH2FNMjT6os+018BgRnRNyfP/xi5goa0K4vcHyg6v49tZSqrhUFMsE2DzjgaCskPrVqq oBnw== 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=kB8uxQiS90SPO5iGxZ/2YeJ9BVmB7a7qIFg8n8U/XRU=; b=YOyunI335mG6jjvKueEf2UkfP8qqqK/kxGke7f4JxcX7j6AC1EcP4iV2vMeHhRaNya 6V6bbVn3cMOuboRvwVkF2CFlSh077gBkwzc2oHXFEmUI5Fj3rpqK3jkTqqyk5eoY9YoU AXyF6/RxU26VevU2duDBE9F3WIbJT6gmB+EpL2hW1c4gZ5889pQe8fmMM7FmQFWIpCKo vv7c4PlsvGwSiU8uH2zrSb2eUEnSlsAUCGgP08zPEOudBg5lo3c25ckexjXY0XaDGh8K aGxGUDLeSVe31BZPI9k3ObbA+kuLNqGbPp1HEudiZ0fQ9NjCvuqTtoTQv38PVNy1MOPi IJqw== ARC-Authentication-Results: i=1; gmr-mx.google.com; spf=neutral (google.com: 212.18.0.10 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.10]) by gmr-mx.google.com with ESMTPS id i16si6795wrq.4.2020.05.04.14.33.05 for (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Mon, 04 May 2020 14:33:05 -0700 (PDT) Received-SPF: neutral (google.com: 212.18.0.10 is neither permitted nor denied by best guess record for domain of sbabic@denx.de) client-ip=212.18.0.10; Received: from frontend01.mail.m-online.net (unknown [192.168.8.182]) by mail-out.m-online.net (Postfix) with ESMTP id 49GGL93cCvz1s2Yr; Mon, 4 May 2020 23:33:05 +0200 (CEST) Received: from localhost (dynscan1.mnet-online.de [192.168.6.70]) by mail.m-online.net (Postfix) with ESMTP id 49GGL939svz1qr4P; Mon, 4 May 2020 23:33:05 +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 47yYBm8Ysc92; Mon, 4 May 2020 23:33:04 +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; Mon, 4 May 2020 23:33:04 +0200 (CEST) Received: from localhost (mail.babic.homelinux.org [127.0.0.1]) by babic.homelinux.org (Postfix) with ESMTP id 620844540554; Mon, 4 May 2020 23:33:04 +0200 (CEST) X-Virus-Scanned: Debian amavisd-new at babic.homelinux.org Received: from babic.homelinux.org ([IPv6:::1]) by localhost (mail.babic.homelinux.org [IPv6:::1]) (amavisd-new, port 10024) with ESMTP id Wxlbf2jwj0rn; Mon, 4 May 2020 23:33:01 +0200 (CEST) Received: from paperino.fritz.box (paperino.fritz.box [192.168.178.64]) by babic.homelinux.org (Postfix) with ESMTP id 1E0F84540691; Mon, 4 May 2020 23:33:01 +0200 (CEST) From: Stefano Babic To: swupdate@googlegroups.com Cc: Stefano Babic Subject: [swupdate] [PATCH] tools: fix coverity #292171 in swupdate-progress Date: Mon, 4 May 2020 23:32:59 +0200 Message-Id: <20200504213259.1859222-2-sbabic@denx.de> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20200504213259.1859222-1-sbabic@denx.de> References: <20200504213259.1859222-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.10 is neither permitted nor denied by best guess record for domain of sbabic@denx.de) smtp.mailfrom=sbabic@denx.de Precedence: list Mailing-list: list swupdate@googlegroups.com; contact swupdate+owners@googlegroups.com List-ID: X-Spam-Checked-In-Group: swupdate@googlegroups.com X-Google-Group-Id: 605343134186 List-Post: , List-Help: , List-Archive: , List-Unsubscribe: , Signed-off-by: Stefano Babic --- tools/swupdate-progress.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/swupdate-progress.c b/tools/swupdate-progress.c index 01d926e..5a2c888 100644 --- a/tools/swupdate-progress.c +++ b/tools/swupdate-progress.c @@ -279,8 +279,8 @@ int main(int argc, char **argv) if (msg.infolen > 0) { if (msg.infolen >= sizeof(msg.info) - 1) { msg.infolen = sizeof(msg.info) - 1; - msg.info[sizeof(msg.info) - 1] = '\0'; } + msg.info[msg.infolen] = '\0'; fprintf(stdout, "INFO : %s\n\n", msg.info); } msg.cur_image[sizeof(msg.cur_image) - 1] = '\0';