aboutsummaryrefslogtreecommitdiff
path: root/libarchive
diff options
context:
space:
mode:
Diffstat (limited to 'libarchive')
-rw-r--r--libarchive/archive.h4
-rw-r--r--libarchive/archive_entry.h2
-rw-r--r--libarchive/archive_read_disk_windows.c2
-rw-r--r--libarchive/archive_read_support_filter_uu.c8
-rw-r--r--libarchive/archive_read_support_format_cab.c2
-rw-r--r--libarchive/archive_read_support_format_cpio.c6
-rw-r--r--libarchive/archive_read_support_format_lha.c2
-rw-r--r--libarchive/archive_read_support_format_mtree.c12
-rw-r--r--libarchive/archive_string.c4
-rw-r--r--libarchive/archive_util.c2
-rw-r--r--libarchive/archive_windows.c5
-rw-r--r--libarchive/archive_write_open_fd.c6
-rw-r--r--libarchive/archive_write_open_file.c6
-rw-r--r--libarchive/archive_write_open_memory.c6
-rw-r--r--libarchive/archive_write_set_format_shar.c5
-rw-r--r--libarchive/archive_write_set_format_ustar.c2
-rw-r--r--libarchive/test/test_compat_lzip.c4
17 files changed, 35 insertions, 43 deletions
diff --git a/libarchive/archive.h b/libarchive/archive.h
index 0eda822ae6bf..a9d34beb4f5a 100644
--- a/libarchive/archive.h
+++ b/libarchive/archive.h
@@ -34,7 +34,7 @@
* assert that ARCHIVE_VERSION_NUMBER >= 2012108.
*/
/* Note: Compiler will complain if this does not match archive_entry.h! */
-#define ARCHIVE_VERSION_NUMBER 3008004
+#define ARCHIVE_VERSION_NUMBER 3008005
#include <sys/stat.h>
#include <stddef.h> /* for wchar_t */
@@ -177,7 +177,7 @@ __LA_DECL int archive_version_number(void);
/*
* Textual name/version of the library, useful for version displays.
*/
-#define ARCHIVE_VERSION_ONLY_STRING "3.8.4"
+#define ARCHIVE_VERSION_ONLY_STRING "3.8.5"
#define ARCHIVE_VERSION_STRING "libarchive " ARCHIVE_VERSION_ONLY_STRING
__LA_DECL const char * archive_version_string(void);
diff --git a/libarchive/archive_entry.h b/libarchive/archive_entry.h
index 74466f394c4a..b43435692c27 100644
--- a/libarchive/archive_entry.h
+++ b/libarchive/archive_entry.h
@@ -28,7 +28,7 @@
#define ARCHIVE_ENTRY_H_INCLUDED
/* Note: Compiler will complain if this does not match archive.h! */
-#define ARCHIVE_VERSION_NUMBER 3008004
+#define ARCHIVE_VERSION_NUMBER 3008005
/*
* Note: archive_entry.h is for use outside of libarchive; the
diff --git a/libarchive/archive_read_disk_windows.c b/libarchive/archive_read_disk_windows.c
index 17557a891039..117ca505fadd 100644
--- a/libarchive/archive_read_disk_windows.c
+++ b/libarchive/archive_read_disk_windows.c
@@ -1468,7 +1468,7 @@ update_current_filesystem(struct archive_read_disk *a, int64_t dev)
return (ARCHIVE_FATAL);
}
t->filesystem_table = (struct filesystem *)p;
- t->allocated_filesystem = (int)s;
+ t->allocated_filesystem = s;
}
t->current_filesystem_id = fid;
t->current_filesystem = &(t->filesystem_table[fid]);
diff --git a/libarchive/archive_read_support_filter_uu.c b/libarchive/archive_read_support_filter_uu.c
index d722fe343657..acb8feb79b2d 100644
--- a/libarchive/archive_read_support_filter_uu.c
+++ b/libarchive/archive_read_support_filter_uu.c
@@ -232,8 +232,8 @@ bid_get_line(struct archive_read_filter *filter,
size_t nbytes_req = (*ravail+1023) & ~1023U;
ssize_t tested;
- /* Increase reading bytes if it is not enough to at least
- * new two lines. */
+ /* Increase reading bytes if it is not enough for at least
+ * two new lines. */
if (nbytes_req < (size_t)*ravail + 160)
nbytes_req <<= 1;
@@ -411,7 +411,7 @@ ensure_in_buff_size(struct archive_read_filter *self,
/*
* Calculate a new buffer size for in_buff.
- * Increase its value until it has enough size we need.
+ * Increase its value until it is enough for our needs.
*/
newsize = uudecode->in_allocated;
do {
@@ -494,7 +494,7 @@ read_more:
}
/*
* If there is remaining data which is saved by
- * previous calling, use it first.
+ * a previous call, use it first.
*/
if (ensure_in_buff_size(self, uudecode,
avail_in + uudecode->in_cnt) != ARCHIVE_OK)
diff --git a/libarchive/archive_read_support_format_cab.c b/libarchive/archive_read_support_format_cab.c
index a96f7d313951..63755ef9e579 100644
--- a/libarchive/archive_read_support_format_cab.c
+++ b/libarchive/archive_read_support_format_cab.c
@@ -2813,7 +2813,7 @@ lzx_decode_blocks(struct lzx_stream *strm, int last)
lzx_br_bits(&bre, mt_max_bits));
lzx_br_consume(&bre, mt_bitlen[c]);
}
- if (c > UCHAR_MAX)
+ if ((unsigned int)c > UCHAR_MAX)
break;
/*
* 'c' is exactly literal code.
diff --git a/libarchive/archive_read_support_format_cpio.c b/libarchive/archive_read_support_format_cpio.c
index 74f3549d159e..526096b39f75 100644
--- a/libarchive/archive_read_support_format_cpio.c
+++ b/libarchive/archive_read_support_format_cpio.c
@@ -825,9 +825,9 @@ header_odc(struct archive_read *a, struct cpio *cpio,
}
/*
- * NOTE: if a filename suffix is ".z", it is the file gziped by afio.
- * it would be nice that we can show uncompressed file size and we can
- * uncompressed file contents automatically, unfortunately we have nothing
+ * NOTE: if a filename suffix is ".z", it is a file gzipped by afio.
+ * it would be nice if we could show uncompressed file size and
+ * uncompress file contents automatically, unfortunately we have nothing
* to get a uncompressed file size while reading each header. It means
* we also cannot uncompress file contents under our framework.
*/
diff --git a/libarchive/archive_read_support_format_lha.c b/libarchive/archive_read_support_format_lha.c
index abf8b8799636..cf6a147abda6 100644
--- a/libarchive/archive_read_support_format_lha.c
+++ b/libarchive/archive_read_support_format_lha.c
@@ -2374,7 +2374,7 @@ lzh_decode_blocks(struct lzh_stream *strm, int last)
lzh_br_consume(&bre, lt_bitlen[c]);
}
blocks_avail--;
- if (c > UCHAR_MAX)
+ if ((unsigned int)c > UCHAR_MAX)
/* Current block is a match data. */
break;
/*
diff --git a/libarchive/archive_read_support_format_mtree.c b/libarchive/archive_read_support_format_mtree.c
index 96d2c71f4c4f..10c07b05d965 100644
--- a/libarchive/archive_read_support_format_mtree.c
+++ b/libarchive/archive_read_support_format_mtree.c
@@ -392,8 +392,8 @@ next_line(struct archive_read *a,
if (len >= MAX_LINE_LEN)
return (-1);
- /* Increase reading bytes if it is not enough to at least
- * new two lines. */
+ /* Increase reading bytes if it is not enough for at least
+ * two new lines. */
if (nbytes_req < (size_t)*ravail + 160)
nbytes_req <<= 1;
@@ -568,8 +568,8 @@ bid_keyword_list(const char *p, ssize_t len, int unset, int last_is_path)
--len;
value = 1;
}
- /* A keyword should have a its value unless
- * "/unset" operation. */
+ /* A keyword should have a value unless this is
+ * an "/unset" operation. */
if (!unset && value == 0)
return (-1);
}
@@ -752,7 +752,7 @@ detect_form(struct archive_read *a, int *is_form_d)
} else if (form_D == 1) {
if (!last_is_path && keywords > 0)
/* This this is not `form D'
- * and We cannot accept mixed
+ * and we cannot accept mixed
* format. */
break;
}
@@ -805,7 +805,7 @@ detect_form(struct archive_read *a, int *is_form_d)
* to read the entire mtree file into memory up front.
*
* The parsing is done in two steps. First, it is decided if a line
- * changes the global defaults and if it is, processed accordingly.
+ * changes the global defaults and if it does, it is processed accordingly.
* Otherwise, the options of the line are merged with the current
* global options.
*/
diff --git a/libarchive/archive_string.c b/libarchive/archive_string.c
index 740308b6e4e3..a776dc85c688 100644
--- a/libarchive/archive_string.c
+++ b/libarchive/archive_string.c
@@ -3573,7 +3573,7 @@ win_strncat_from_utf16(struct archive_string *as, const void *_p, size_t bytes,
if (sc->to_cp == CP_C_LOCALE) {
/*
- * "C" locale special process.
+ * "C" locale special processing.
*/
u16 = _p;
ll = 0;
@@ -3690,7 +3690,7 @@ win_strncat_to_utf16(struct archive_string *as16, const void *_p,
avail = as16->buffer_length - 2;
if (sc->from_cp == CP_C_LOCALE) {
/*
- * "C" locale special process.
+ * "C" locale special processing.
*/
count = 0;
while (count < length && *s) {
diff --git a/libarchive/archive_util.c b/libarchive/archive_util.c
index d048bbc94650..0d1de1ef2091 100644
--- a/libarchive/archive_util.c
+++ b/libarchive/archive_util.c
@@ -456,7 +456,7 @@ __archive_issetugid(void)
return (-1);
if (ruid != euid || ruid != suid)
return (1);
- if (getresgid(&ruid, &egid, &sgid) != 0)
+ if (getresgid(&rgid, &egid, &sgid) != 0)
return (-1);
if (rgid != egid || rgid != sgid)
return (1);
diff --git a/libarchive/archive_windows.c b/libarchive/archive_windows.c
index e55f995c7702..3fbea6c5b6dd 100644
--- a/libarchive/archive_windows.c
+++ b/libarchive/archive_windows.c
@@ -253,7 +253,7 @@ la_CreateFile(const char *path, DWORD dwDesiredAccess, DWORD dwShareMode,
createExParams.dwSize = sizeof(createExParams);
createExParams.dwFileAttributes = dwFlagsAndAttributes & 0xFFFF;
createExParams.dwFileFlags = dwFlagsAndAttributes & 0xFFF00000;
- createExParams.dwSecurityQosFlags = dwFlagsAndAttributes & 0x000F00000;
+ createExParams.dwSecurityQosFlags = dwFlagsAndAttributes & 0x000F0000;
createExParams.lpSecurityAttributes = lpSecurityAttributes;
createExParams.hTemplateFile = hTemplateFile;
handle = CreateFile2(wpath, dwDesiredAccess, dwShareMode,
@@ -747,7 +747,8 @@ __la_seek_fstat(int fd, la_seek_stat_t *st)
int ret;
ret = __hstat((HANDLE)_get_osfhandle(fd), &u);
- copy_seek_stat(st, &u);
+ if (ret >= 0)
+ copy_seek_stat(st, &u);
return (ret);
}
diff --git a/libarchive/archive_write_open_fd.c b/libarchive/archive_write_open_fd.c
index ba034ed92f8a..a795552020df 100644
--- a/libarchive/archive_write_open_fd.c
+++ b/libarchive/archive_write_open_fd.c
@@ -135,11 +135,7 @@ file_write(struct archive *a, void *client_data, const void *buff, size_t length
static int
file_free(struct archive *a, void *client_data)
{
- struct write_fd_data *mine = (struct write_fd_data *)client_data;
-
(void)a; /* UNUSED */
- if (mine == NULL)
- return (ARCHIVE_OK);
- free(mine);
+ free(client_data);
return (ARCHIVE_OK);
}
diff --git a/libarchive/archive_write_open_file.c b/libarchive/archive_write_open_file.c
index 0b310f3da83b..6271b368d07f 100644
--- a/libarchive/archive_write_open_file.c
+++ b/libarchive/archive_write_open_file.c
@@ -96,11 +96,7 @@ file_write(struct archive *a, void *client_data, const void *buff, size_t length
static int
file_free(struct archive *a, void *client_data)
{
- struct write_FILE_data *mine = client_data;
-
(void)a; /* UNUSED */
- if (mine == NULL)
- return (ARCHIVE_OK);
- free(mine);
+ free(client_data);
return (ARCHIVE_OK);
}
diff --git a/libarchive/archive_write_open_memory.c b/libarchive/archive_write_open_memory.c
index e31650447279..3b929ac7f60d 100644
--- a/libarchive/archive_write_open_memory.c
+++ b/libarchive/archive_write_open_memory.c
@@ -104,11 +104,7 @@ memory_write(struct archive *a, void *client_data, const void *buff, size_t leng
static int
memory_write_free(struct archive *a, void *client_data)
{
- struct write_memory_data *mine;
(void)a; /* UNUSED */
- mine = client_data;
- if (mine == NULL)
- return (ARCHIVE_OK);
- free(mine);
+ free(client_data);
return (ARCHIVE_OK);
}
diff --git a/libarchive/archive_write_set_format_shar.c b/libarchive/archive_write_set_format_shar.c
index be9f78ce96cd..f6f28debdfa9 100644
--- a/libarchive/archive_write_set_format_shar.c
+++ b/libarchive/archive_write_set_format_shar.c
@@ -144,7 +144,9 @@ archive_write_set_format_shar_dump(struct archive *_a)
struct archive_write *a = (struct archive_write *)_a;
struct shar *shar;
- archive_write_set_format_shar(&a->archive);
+ int ret = archive_write_set_format_shar(&a->archive);
+ if (ret != ARCHIVE_OK)
+ return ret;
shar = (struct shar *)a->format_data;
shar->dump = 1;
a->format_write_data = archive_write_shar_data_uuencode;
@@ -240,6 +242,7 @@ archive_write_shar_header(struct archive_write *a, struct archive_entry *entry)
shar_quote(&shar->work, p, 1);
archive_strcat(&shar->work,
" > /dev/null 2>&1\n");
+ free(shar->last_dir);
shar->last_dir = p;
}
} else {
diff --git a/libarchive/archive_write_set_format_ustar.c b/libarchive/archive_write_set_format_ustar.c
index 09b71fe6672a..4084eb455968 100644
--- a/libarchive/archive_write_set_format_ustar.c
+++ b/libarchive/archive_write_set_format_ustar.c
@@ -539,7 +539,7 @@ __archive_write_format_header_ustar(struct archive_write *a, char h[512],
ret = ARCHIVE_WARN;
}
if (copy_length > 0) {
- if (strlen(p) > USTAR_gname_size) {
+ if (copy_length > USTAR_gname_size) {
if (tartype != 'x') {
archive_set_error(&a->archive,
ARCHIVE_ERRNO_MISC, "Group name too long");
diff --git a/libarchive/test/test_compat_lzip.c b/libarchive/test/test_compat_lzip.c
index 50920eefb1cf..cd246b943b22 100644
--- a/libarchive/test/test_compat_lzip.c
+++ b/libarchive/test/test_compat_lzip.c
@@ -47,7 +47,7 @@ echo "f3" > $dir/d1/f3
rm -r $dir
}
#
-# Make a lzip file from split tar file.
+# Make a lzip file from the split tar file.
#
name=test_compat_lzip_1
dir="$name`date +%Y%m%d%H%M%S`.$USER"
@@ -75,7 +75,7 @@ exit 0
*/
/*
- * Verify our ability to read sample files compatibly with lzip.
+ * Verify our ability to read the sample files compatibly with lzip.
*
* In particular:
* * lzip will read multiple lzip streams, concatenating the output