From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from out3-smtp.messagingengine.com (out3-smtp.messagingengine.com [66.111.4.27]) by sourceware.org (Postfix) with ESMTPS id 41FBD3858D37 for ; Fri, 28 Apr 2023 06:04:36 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 41FBD3858D37 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=gllghr.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=gllghr.com Received: from compute2.internal (compute2.nyi.internal [10.202.2.46]) by mailout.nyi.internal (Postfix) with ESMTP id 70DAC5C00D6 for ; Fri, 28 Apr 2023 02:04:33 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute2.internal (MEProxy); Fri, 28 Apr 2023 02:04:33 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gllghr.com; h=cc :content-type:content-type:date:date:from:from:in-reply-to :message-id:mime-version:reply-to:sender:subject:subject:to:to; s=fm3; t=1682661873; x=1682748273; bh=/SyC4fKLJbrQXpNLHu7qfG6c+ qeAv+IunJmDhisoj+o=; b=L0LR4/Tk7fi4gNYcW6hLFdS6m2AugePeH21OtKVyO oLeC5JEBirn41YGx30XlXQ+OTgd/1xbuJ7PsmC5SHDphglpMfz1AnxevfGku750M AavaGJhoJqZLKTwg+ifBFHqwE306M/7fhr923KJRCEEH5ljXvzGzIecscf5vm+qq mMNYYD2r7kT70H/hUO5TrS/kJ+DmU8Y+0csm0C1kfe8CtjO2hKtfqwCMsxH8yyEi ImZ4CSE3w2vGjsOuNVeXfEEIqhrbfAdU+IPZ/uHHaQ2SbpoQDOKiF/qiMXM/DRPl mS75tRXoookvexdo2CKfGVVQb5Bz4Cu/RFN5B4zrlJGQg== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-type:content-type:date:date :feedback-id:feedback-id:from:from:in-reply-to:message-id :mime-version:reply-to:sender:subject:subject:to:to:x-me-proxy :x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s=fm3; t= 1682661873; x=1682748273; bh=/SyC4fKLJbrQXpNLHu7qfG6c+qeAv+IunJm Dhisoj+o=; b=GvL6nPgtzBz3w99bnya47UEuBtglwK7BDg82mNXkQS8vW7GDBpZ i0JppjY5/Rmwvd9j/232FnuOkrOxHXRJmmJwH7DBdi5ooUelJqsq2x3sf0NPvVHs TQN9C+k0RFgo1vaQXKAa4pPalH31+q58N0pXfoAcmPr4WrfnENj9dkoiLNdaMeA4 WX5BCV+k8ne+hUJAIyrPR0Lx58BMcrEbM4zACl9VcCojgf8wNWHuqilApydUvdSr JamxJhCiW0gFLz/Oq7KivocQj2BT1fWiiMpuvbOQ1+Z2MfuGugexOPEftUiNjGIG 1u1IgQ1QkU2rH12CHjNzuULTweNeMGnG6iA== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvhedrfedujedguddthecutefuodetggdotefrod ftvfcurfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfgh necuuegrihhlohhuthemuceftddtnecunecujfgurhepfffhvffukfggtggusehttdertd dttddvnecuhfhrohhmpeflohhhnhcuifgrlhhlrghghhgvrhcuoehjohhhnhesghhllhhg hhhrrdgtohhmqeenucggtffrrghtthgvrhhnpeeltdegudfhfffhudeuhfdtheeludeigf ejtdeuvdfhudfhveegfeetueefueetkeenucevlhhushhtvghrufhiiigvpedtnecurfgr rhgrmhepmhgrihhlfhhrohhmpehjohhhnhesghhllhhghhhrrdgtohhm X-ME-Proxy: Feedback-ID: i82914413:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA for ; Fri, 28 Apr 2023 02:04:32 -0400 (EDT) Date: Thu, 27 Apr 2023 23:04:31 -0700 From: John Gallagher To: elfutils-devel@sourceware.org Subject: [PATCH] libdwfl: Fix memory leak in unzip() Message-ID: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline X-Spam-Status: No, score=-13.4 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,GIT_PATCH_0,JMQ_SPF_NEUTRAL,RCVD_IN_DNSWL_LOW,RCVD_IN_MSPIKE_H2,SPF_HELO_PASS,SPF_PASS,TXREP,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org List-Id: state.input_buffer is not freed if the file is found to not be compressed with the compression algorithm unzip() is trying to use. Signed-off-by: John Gallagher --- libdwfl/ChangeLog | 4 ++++ libdwfl/gzip.c | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/libdwfl/ChangeLog b/libdwfl/ChangeLog index daef2828..54d85921 100644 --- a/libdwfl/ChangeLog +++ b/libdwfl/ChangeLog @@ -1,3 +1,7 @@ +2023-04-24 John Gallagher + + * gzip.c: Fix memory leak in unzip() + 2023-02-06 Mark Wielaard * libdwfl.h: Guard debuginfod_client typedef with diff --git a/libdwfl/gzip.c b/libdwfl/gzip.c index 53013be3..002afc4e 100644 --- a/libdwfl/gzip.c +++ b/libdwfl/gzip.c @@ -227,7 +227,7 @@ unzip (int fd, off_t start_offset, #endif ) /* Not a compressed file. */ - return DWFL_E_BADELF; + return fail (&state, DWFL_E_BADELF); #ifdef ZSTD /* special case for libzstd since it is slightly different from the -- 2.40.0