]> git.ipfire.org Git - thirdparty/libarchive.git/commitdiff
Set *result to 0 when the tar flush fails. 2778/head
authorAZero13 <gfunni234@gmail.com>
Thu, 6 Nov 2025 15:02:41 +0000 (10:02 -0500)
committerAZero13 <gfunni234@gmail.com>
Thu, 6 Nov 2025 15:02:41 +0000 (10:02 -0500)
We should not uninitialize 0 when an error happens. Because t is then checked.

libarchive/archive_read_support_format_tar.c

index eeb2c725f6ebdde033e561d3f4a204a0d3a79c92..98f7d699570a0a7bdad7bf4cecabb51e81855702 100644 (file)
@@ -2311,6 +2311,7 @@ pax_attribute_read_number(struct archive_read *a, size_t value_length, int64_t *
        archive_string_init(&as);
        r = read_bytes_to_string(a, &as, value_length, &unconsumed);
        if (tar_flush_unconsumed(a, &unconsumed) != ARCHIVE_OK) {
+               *result = 0;
                return (ARCHIVE_FATAL);
        }
        if (r < ARCHIVE_OK) {