]> git.ipfire.org Git - thirdparty/libarchive.git/commitdiff
We copy from p, not p + module_len 2813/head
authorAZero13 <gfunni234@gmail.com>
Wed, 17 Dec 2025 02:38:55 +0000 (21:38 -0500)
committerAZero13 <gfunni234@gmail.com>
Wed, 17 Dec 2025 02:41:05 +0000 (21:41 -0500)
tar/write.c

index 9e6c97b580b7304b5c7fbea8f9ed7d64ec836c99..96920a40d35b23ae439670e9a90f65c0ce59b5dd 100644 (file)
@@ -163,7 +163,7 @@ set_writer_options(struct bsdtar *bsdtar, struct archive *a)
                 * a format or filters which are not added to
                 * the archive write object. */
                memcpy(p, IGNORE_WRONG_MODULE_NAME, module_len);
-               memcpy(p, writer_options, opt_len);
+               memcpy(p + module_len, writer_options, opt_len);
                r = archive_write_set_options(a, p);
                free(p);
                if (r < ARCHIVE_WARN)
@@ -196,7 +196,7 @@ set_reader_options(struct bsdtar *bsdtar, struct archive *a)
                 * a format or filters which are not added to
                 * the archive write object. */
                memcpy(p, IGNORE_WRONG_MODULE_NAME, module_len);
-               memcpy(p, reader_options, opt_len);
+               memcpy(p + module_len, reader_options, opt_len);
                r = archive_read_set_options(a, p);
                free(p);
                if (r < ARCHIVE_WARN)