mirror of
https://github.com/opnsense/src.git
synced 2026-06-13 18:50:31 -04:00
Fix an aliasing error in the new TP support and reenable it in the build.
This commit is contained in:
parent
8872e3d7e5
commit
2cac97cafe
2 changed files with 5 additions and 3 deletions
|
|
@ -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 \
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
|
|
|
|||
Loading…
Reference in a new issue