From patchwork Mon Nov 6 15:32:35 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peter Maydell X-Patchwork-Id: 741416 Delivered-To: patch@linaro.org Received: by 2002:adf:fd90:0:b0:32d:baff:b0ca with SMTP id d16csp1152742wrr; Mon, 6 Nov 2023 07:36:05 -0800 (PST) X-Google-Smtp-Source: AGHT+IFAKybDLU3JcDMYRyJsLXPC4ebDSYU95N0jEBNJWtOQ+NAgS360LXYdw7kNPJHTmGy94k4o X-Received: by 2002:a05:6830:168c:b0:6c4:cda6:ff31 with SMTP id k12-20020a056830168c00b006c4cda6ff31mr25522961otr.15.1699284965180; Mon, 06 Nov 2023 07:36:05 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1699284965; cv=none; d=google.com; s=arc-20160816; b=QXnRHqPqeIt4cwWhQcdx+V5UmyKvUOKIZxpkEfmqS+vncXixnYCnfTgh0F4XDaDhAV lgj2Cyq4GkjRfNFLIUh//7mZA5EJUuobBpeyHXNGidyGjjswbnV6EMLb7HUleF27sG+1 6wm4GalOuztLkTrTaoGScnxAjyOxzJeaTVKLdfrtBVu/zO1uMwg8FcfNfRtzbwi2uzV5 2gk/qo2UYa1oiKlB7ycK8DSnHhRKOOw0iyAEQB2gptVWmi3TAoKPdk/po0hmZjWbfWDA NZ7Q79oLiqvbeHva5JXBmxB9U2xV3sdjv3XSRRbu7yFytsqOJ+dv8LKkw59cFMbCbjWW IwQg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:to:from :dkim-signature; bh=wE3VrpMqQ5iO8rOEAjV8Na1iX3YBEUPnu4z7701xXsQ=; fh=PnYt+qEB9tAfMKoqBm2xjKOFpYyFFGPudh5cVIoieJM=; b=Hmm09W8GrItJU36tHzksKmIP3swVkKACfFlEAaI3NmmO6SeKZ+RnncQb911EAG1o9M vzPpYcUAEJC/GwYxmPqtancEJmOwdAfZaMeu4TotudEjbIK4UGG2Al5lBoQCPUXuD/3u Puj26hXEC7m9eDcp4jyMCsRGLd8MMem5cK9d6XEAeFSlDnAz7jI9yh8HE6U9cGNttfXY eUJF80hJi7aeqMHaPj5kZkwkyFHdtVtIJmhE6rQjPw3u6y5hJut6ez5Qlaz2FFfbkEWs myEIVpliqJ+eBw08Wr9Ql0JZ3/qckPUrw14G5UxINc5g6yUVUPJUDEDu2/bLJIQMtCnO 5yFw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=s7bd05mj; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id m14-20020a05622a054e00b0041811753adbsi5661440qtx.342.2023.11.06.07.36.05 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Mon, 06 Nov 2023 07:36:05 -0800 (PST) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=s7bd05mj; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1r01b8-0008Oe-47; Mon, 06 Nov 2023 10:33:06 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1r01aw-00082T-Q2 for qemu-devel@nongnu.org; Mon, 06 Nov 2023 10:32:57 -0500 Received: from mail-wr1-x434.google.com ([2a00:1450:4864:20::434]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1r01am-0004O6-QZ for qemu-devel@nongnu.org; Mon, 06 Nov 2023 10:32:53 -0500 Received: by mail-wr1-x434.google.com with SMTP id ffacd0b85a97d-32f7c80ab33so2789120f8f.0 for ; Mon, 06 Nov 2023 07:32:44 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1699284763; x=1699889563; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:from:to:cc:subject:date:message-id :reply-to; bh=wE3VrpMqQ5iO8rOEAjV8Na1iX3YBEUPnu4z7701xXsQ=; b=s7bd05mjTtL1wWAdbx3tFffUAd6t5AGzOhoW0y1S8Pal+lZniOwig2FvmnVjNY4yxM uD2YPgV5Q5oSjA2yzxTkZ9a5+nUv1oZWpBqiHknV0iQ1e/FC24g/uVyirADzoV6EkpIm dbMCHJ/MIOvvHt9pCdmTV9zUxPsEkaQwnTf4gPekswgizQJcIT19wlQgm8wSa/9whBNd MXQqRt++KIAm8lVi/zDwA04Kt3X8lrP14SkBx0stw+WsdJIV3OyCqqZsMAB6PJci7kLi l0I7zm+tIWAj94doZDBGGaVUDPkJl39LeId7ADK8xMmtfMMYBlCNqtHe5d5yLWUYprtk jy0w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1699284763; x=1699889563; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=wE3VrpMqQ5iO8rOEAjV8Na1iX3YBEUPnu4z7701xXsQ=; b=QOLoZNQQsOgxBMcmswT4Xwr9q5KcXJTstVtpkSDB9OOpIMlgBOXVfwqzI/qeKr9CoD HLz7ij/UusChy4W8JQGvfD0c7G3np4NCECR6+I4x9VsYLkXlN0aSCdIXILIiG/PS4nB5 xbnitmakVGnnocY9CZIk2Ezqc5G4Y49sz9Fuyfep+8R3oFcKjvvia19AIKMve5QyEyLL jsXuC7Ah7kahbWUUJ9P2u4ncPul/BkYSQAqqgx26Cu7ijJd6VZx4zOwQZsM2hOBK3O4e ZhvcPICYU8qbj9kfTe+322IM5Dj+1WD+uSnRBRihKC9Y25zHf45JUzPcXS6i/zFuwoPZ A1fA== X-Gm-Message-State: AOJu0YyQXx0NxXldHMVCBUsaVZ/wwIW6b060OJEJ0CawmODJo0DBFbwz SLInMVgkH8+vHWk5Ev5Xsz7FXA2R4kBCG7Kgnpo= X-Received: by 2002:a05:6000:1882:b0:32f:aaaf:dad8 with SMTP id a2-20020a056000188200b0032faaafdad8mr10779315wri.47.1699284763531; Mon, 06 Nov 2023 07:32:43 -0800 (PST) Received: from orth.archaic.org.uk (orth.archaic.org.uk. [2001:8b0:1d0::2]) by smtp.gmail.com with ESMTPSA id d5-20020adff2c5000000b0032da6f17ffdsm9752176wrp.38.2023.11.06.07.32.43 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 06 Nov 2023 07:32:43 -0800 (PST) From: Peter Maydell To: qemu-devel@nongnu.org Subject: [PULL 09/12] hw/core/loader: gunzip(): initialize z_stream Date: Mon, 6 Nov 2023 15:32:35 +0000 Message-Id: <20231106153238.1426649-10-peter.maydell@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20231106153238.1426649-1-peter.maydell@linaro.org> References: <20231106153238.1426649-1-peter.maydell@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::434; envelope-from=peter.maydell@linaro.org; helo=mail-wr1-x434.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org From: Vladimir Sementsov-Ogievskiy Coverity signals that variable as being used uninitialized. And really, when work with external APIs that's better to zero out the structure, where we set some fields by hand. Signed-off-by: Vladimir Sementsov-Ogievskiy Reviewed-by: Peter Maydell Reviewed-by: Maksim Davydov Message-id: 20231017125941.810461-6-vsementsov@yandex-team.ru Signed-off-by: Peter Maydell --- hw/core/loader.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hw/core/loader.c b/hw/core/loader.c index 4dd5a71fb79..b7bb44b7f7c 100644 --- a/hw/core/loader.c +++ b/hw/core/loader.c @@ -558,7 +558,7 @@ static void zfree(void *x, void *addr) ssize_t gunzip(void *dst, size_t dstlen, uint8_t *src, size_t srclen) { - z_stream s; + z_stream s = {}; ssize_t dstbytes; int r, i, flags;