This is an automated email from the git hooks/post-receive script.

guillem pushed a commit to branch main
in repository dpkg.

View the commit online:
https://git.dpkg.org/cgit/dpkg/dpkg.git/commit/?id=bb7a54bfb4ccadf025b5ecec79fcf0ecdd80be12

commit bb7a54bfb4ccadf025b5ecec79fcf0ecdd80be12
Author: Guillem Jover <[email protected]>
AuthorDate: Sun Nov 28 23:58:19 2021 +0100

    libdpkg: Fix memory leak on End Of Tape condition in tar parser
    
    When we are at the End Of Tape entry, the checksum verification will
    fail, set an error, and return, we then detect that condition and reset
    the status code, but were not freeing the error.
    
    Warned-by: gcc ASAN
---
 lib/dpkg/tarfn.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/lib/dpkg/tarfn.c b/lib/dpkg/tarfn.c
index 41641b934..f5ef155a6 100644
--- a/lib/dpkg/tarfn.c
+++ b/lib/dpkg/tarfn.c
@@ -464,6 +464,10 @@ tar_extractor(struct tar_archive *tar)
 
                if (tar_header_decode((struct tar_header *)buffer, &h, 
&tar->err) < 0) {
                        if (h.name[0] == '\0') {
+                               /* The checksum failed on the terminating
+                                * End Of Tape block entry of zeros. */
+                               dpkg_error_destroy(&tar->err);
+
                                /* End Of Tape. */
                                status = 0;
                        } else {

-- 
Dpkg.Org's dpkg

Reply via email to