]> git.ipfire.org Git - thirdparty/libarchive.git/commitdiff
Merge pull request #2768 from Commandoss/master
authorTim Kientzle <kientzle@acm.org>
Sat, 1 Nov 2025 05:07:19 +0000 (22:07 -0700)
committerMartin Matuska <martin@matuska.de>
Mon, 17 Nov 2025 19:19:34 +0000 (20:19 +0100)
Fix for an out-of-bounds buffer overrun when using p[H_LEVEL_OFFSET]

(cherry picked from commit ce614c65246158bcb0dc1f9c1dce5a5af65f9827)

libarchive/archive_read_support_format_lha.c

index 2a84ad9dd307251a9174527d551d35b9c3b2fcc5..abf8b8799636258655c6716b24d6fafbe743d38a 100644 (file)
@@ -689,7 +689,7 @@ archive_read_format_lha_read_header(struct archive_read *a,
         * a pathname and a symlink has '\' character, a directory
         * separator in DOS/Windows. So we should convert it to '/'.
         */
-       if (p[H_LEVEL_OFFSET] == 0)
+       if (lha->level == 0)
                lha_replace_path_separator(lha, entry);
 
        archive_entry_set_mode(entry, lha->mode);