]> git.ipfire.org Git - thirdparty/libarchive.git/commitdiff
Fix joliet pathname buffer overflow 2983/head
authorTim Kientzle <kientzle@acm.org>
Sun, 26 Apr 2026 22:22:10 +0000 (18:22 -0400)
committerTim Kientzle <kientzle@acm.org>
Sun, 26 Apr 2026 22:22:10 +0000 (18:22 -0400)
libarchive/archive_read_support_format_iso9660.c

index c69fcd272bcd5f6460949d78bb48b28bf234b0c0..e3b57869f994304c27d5b512cd30707154608e89 100644 (file)
@@ -3493,6 +3493,8 @@ build_pathname_utf16be(unsigned char *p, size_t max, size_t *len,
        if (file->parent != NULL && file->parent->utf16be_bytes > 0) {
                if (build_pathname_utf16be(p, max, len, file->parent) != 0)
                        return (-1);
+               if (*len + 2 > max)
+                       return (-1);/* Path is too long! */
                p[*len] = 0;
                p[*len + 1] = '/';
                *len += 2;