Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from lists.ozlabs.org (lists.ozlabs.org [112.213.38.117]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id F1A80EE0210 for ; Wed, 13 Sep 2023 22:12:05 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=lists.ozlabs.org; s=201707; t=1694643124; bh=KQCeDJayjacRGiTOvOa8EV92G+cn8qrjSsG8QL7Onxk=; h=Date:In-Reply-To:References:Subject:To:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To:Cc: From; b=a6qa8sp6VeQM7v3QOQ8se97OJHnOmCOB2mZ9cGiuUzx+NxaM+tJnknv46CjS/eCA/ DkpTRgWBGbckjdpKYe+uvUSP7eH0W0kiEOc+W9DC3OigPdZu6LU6sU7gdTfDlVaVIg VfAo8TS2bA8MXFDdnQ8f3yBM7joGIUdi+xYw/LzDIfvBoX5q5bpfAERtqoTFq4bpb4 GoXJePjNK484DGTB+D2K3nf2nuKG8aXZaP7YuXrW+9QmEK0ErNgs/75Ggaqr3CM6Qj eGlXWF6+1Sc7VKJdv/rZ1yZR6qtdDMkbiKxxt4VXc5lUZ5GpGps3XqcYI+EV9Yt3Hv WJitP7KJ0JkVQ== Received: from boromir.ozlabs.org (localhost [IPv6:::1]) by lists.ozlabs.org (Postfix) with ESMTP id 4RmF6r4pS7z3c5P for ; Thu, 14 Sep 2023 08:12:04 +1000 (AEST) Authentication-Results: lists.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=google.com header.i=@google.com header.a=rsa-sha256 header.s=20230601 header.b=k5ufEMIS; dkim-atps=neutral Authentication-Results: lists.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=flex--dhavale.bounces.google.com (client-ip=2607:f8b0:4864:20::1149; helo=mail-yw1-x1149.google.com; envelope-from=3kjmczqckczequninyrtbbtyr.pbzyvahk-rebsfyvfgf.bmynof.bet@flex--dhavale.bounces.google.com; receiver=lists.ozlabs.org) Received: from mail-yw1-x1149.google.com (mail-yw1-x1149.google.com [IPv6:2607:f8b0:4864:20::1149]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by lists.ozlabs.org (Postfix) with ESMTPS id 4RmF6D6v0pz3cG0 for ; Thu, 14 Sep 2023 08:11:32 +1000 (AEST) Received: by mail-yw1-x1149.google.com with SMTP id 00721157ae682-58ee4df08fbso4094997b3.3 for ; Wed, 13 Sep 2023 15:11:32 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1694643091; x=1695247891; h=cc:to:from:subject:message-id:references:mime-version:in-reply-to :date:x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=KQCeDJayjacRGiTOvOa8EV92G+cn8qrjSsG8QL7Onxk=; b=rxglCmfDxNjOsa/ahbY3VEisxuUPeFvp+WKnQZhOhmRc2Peph3JhZtdPsbBU3CyPdV z1S6fs6lfwIQP01rLTrnFY9eVRMcLp/YnNKEIPbOhfThV1XxGT4wIriwZEsTYfB3cypt jCq1D9mQ6WqMGo3RSDHkDbvNCspjD6KF6M/kOrCPVvVCKK4IoeTE0sY2bIONEPx11GSX KGtgqH6YLPF1SXu1dN0ea+fZ/uDKDYpJc6uaPvuWTj8PWAdLDiY0P/eW9jNXsKxK9Wlv LY4z08k1101qE/2HorIyqAPgejvDJKjkXrXt1Cw1kug0atheBV7iH8/i7bYOINhM9NID wCTA== X-Gm-Message-State: AOJu0YzFTtXnhBdYOUbSikSXP9YIGTAr26PtkX2RjH+0YlFSzk17+ubz MgC9KfuQ9O9Qv61yetbx71PFq+muanOVgmF0uIWZ2tSN1wdvy3Mk3WM8Ihde1IWrqujDVlaJnTM 8jfRGtOHoK85SSK/f/Tbw2LjpIQ36UIFG+mtdBcsMj96X9Pc+Q2HbSmVG4w1Q743C1V8fVkoX X-Google-Smtp-Source: AGHT+IF26DsCpY49bm7wyHYhXVw1BNanK4RbzyZ01vuBdPzOukBnoJluuixD3M0DxCFGwBlhWedlpspVdhHg X-Received: from dhavale-ctop.c.googlers.com ([fda3:e722:ac3:cc00:24:72f4:c0a8:5e39]) (user=dhavale job=sendgmr) by 2002:a05:690c:ed5:b0:59b:eace:d46f with SMTP id cs21-20020a05690c0ed500b0059beaced46fmr11868ywb.8.1694643090904; Wed, 13 Sep 2023 15:11:30 -0700 (PDT) Date: Wed, 13 Sep 2023 15:11:04 -0700 In-Reply-To: <20230913221104.429825-1-dhavale@google.com> Mime-Version: 1.0 References: <20230913221104.429825-1-dhavale@google.com> X-Mailer: git-send-email 2.42.0.283.g2d96d420d3-goog Message-ID: <20230913221104.429825-8-dhavale@google.com> Subject: [PATCH v1 7/7] erofs-utils: lib: tar: Initialize the variable to avoid using garbage value To: linux-erofs@lists.ozlabs.org, hsiangkao@linux.alibaba.com Content-Type: text/plain; charset="UTF-8" X-BeenThere: linux-erofs@lists.ozlabs.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Development of Linux EROFS file system List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , From: Sandeep Dhavale via Linux-erofs Reply-To: Sandeep Dhavale Cc: kernel-team@android.com Errors-To: linux-erofs-bounces+linux-erofs=archiver.kernel.org@lists.ozlabs.org Sender: "Linux-erofs" The value in variable 'e' is checked without initializing and can wrongly signify end of tar 2 empty blocks. Signed-off-by: Sandeep Dhavale --- lib/tar.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/tar.c b/lib/tar.c index b58bfd5..c4c89ec 100644 --- a/lib/tar.c +++ b/lib/tar.c @@ -549,7 +549,7 @@ int tarerofs_parse_tar(struct erofs_inode *root, struct erofs_tarfile *tar) char path[PATH_MAX]; struct erofs_pax_header eh = tar->global; struct erofs_sb_info *sbi = root->sbi; - bool e, whout, opq; + bool whout, opq, e = false; struct stat st; erofs_off_t tar_offset, data_offset; -- 2.42.0.283.g2d96d420d3-goog