From: Martin Matuška Date: Fri, 26 Dec 2025 09:22:13 +0000 (+0100) Subject: Merge pull request #2813 from AZero13/memcpy X-Git-Tag: v3.8.5~11 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=c8ea1e5da2a6ab54935aa5659a6eb569840a0704;p=thirdparty%2Flibarchive.git Merge pull request #2813 from AZero13/memcpy We copy from p, not p + module_len (cherry picked from commit b2d68e2f1a24594fbf8e79096ca18ece309497b0) --- diff --git a/tar/write.c b/tar/write.c index 4369bce7f..b39a39770 100644 --- a/tar/write.c +++ b/tar/write.c @@ -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) @@ -195,7 +195,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)