summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorkientzle <kientzle@FreeBSD.org>2006-01-26 05:28:56 +0000
committerkientzle <kientzle@FreeBSD.org>2006-01-26 05:28:56 +0000
commit4a61fe30d00636a2a1faa85d2027a1f623575beb (patch)
treed85acf6e049aa512339c6f93acec19b406b5b709
parent3c93597c0f0360a17add34bed82f0afce62f313c (diff)
downloadFreeBSD-src-4a61fe30d00636a2a1faa85d2027a1f623575beb.zip
FreeBSD-src-4a61fe30d00636a2a1faa85d2027a1f623575beb.tar.gz
Fix an aliasing error in the new TP support and reenable it in the build.
-rw-r--r--lib/libarchive/Makefile1
-rw-r--r--lib/libarchive/archive_read_support_format_tp.c7
2 files changed, 5 insertions, 3 deletions
diff --git a/lib/libarchive/Makefile b/lib/libarchive/Makefile
index 63ea755..a677044 100644
--- a/lib/libarchive/Makefile
+++ b/lib/libarchive/Makefile
@@ -68,6 +68,7 @@ BASE_SRCS= archive_check_magic.c \
archive_read_support_format_cpio.c \
archive_read_support_format_iso9660.c \
archive_read_support_format_tar.c \
+ archive_read_support_format_tp.c \
archive_read_support_format_zip.c \
archive_string.c \
archive_string_sprintf.c \
diff --git a/lib/libarchive/archive_read_support_format_tp.c b/lib/libarchive/archive_read_support_format_tp.c
index e3f63c3..a971a55 100644
--- a/lib/libarchive/archive_read_support_format_tp.c
+++ b/lib/libarchive/archive_read_support_format_tp.c
@@ -274,6 +274,7 @@ archive_read_format_tp_read_header(struct archive *a,
struct stat st;
struct tp *tp;
struct file_info *file;
+ const void *v;
const char *p;
ssize_t bytes_read;
int r;
@@ -283,8 +284,7 @@ archive_read_format_tp_read_header(struct archive *a,
/* Read the entire TOC first. */
if (!tp->toc_read) {
/* Skip the initial block. */
- bytes_read = (a->compression_read_ahead)(a,
- (const void **)&p, 512);
+ bytes_read = (a->compression_read_ahead)(a, &v, 512);
if (bytes_read < 512)
return (ARCHIVE_FATAL);
bytes_read = 512;
@@ -294,12 +294,13 @@ archive_read_format_tp_read_header(struct archive *a,
/* Consume TOC entries. */
do {
bytes_read = (a->compression_read_ahead)(a,
- (const void **)&p, tp->toc_size);
+ &v, tp->toc_size);
if (bytes_read < tp->toc_size)
return (ARCHIVE_FATAL);
bytes_read = tp->toc_size;
tp->current_position += bytes_read;
(a->compression_read_consume)(a, bytes_read);
+ p = (const char *)v;
file = (*tp->parse_file_info)(a, p);
if (file != NULL)
add_entry(tp, file);
OpenPOWER on IntegriCloud