summaryrefslogtreecommitdiff
path: root/libarchive/archive_read_support_format_ar.c
diff options
context:
space:
mode:
authorMartin Matuska <martin@matuska.org>2016-12-08 02:45:41 +0100
committerMartin Matuska <martin@matuska.org>2016-12-08 02:47:41 +0100
commitf167e8d9d521e5536b37098501c6396ab65452e6 (patch)
tree43fb5342aea5f5c09c0730aad2271bfd02ecd527 /libarchive/archive_read_support_format_ar.c
parent4f9783c83b00eb0b2d26a3f95698391b994ea65a (diff)
downloadlibarchive-f167e8d9d521e5536b37098501c6396ab65452e6.tar.gz
Do not read beyond strtab table size in _ar_read_header()
Reported-by: OSS-Fuzz issue 237
Diffstat (limited to 'libarchive/archive_read_support_format_ar.c')
-rw-r--r--libarchive/archive_read_support_format_ar.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/libarchive/archive_read_support_format_ar.c b/libarchive/archive_read_support_format_ar.c
index ff81f5fb..b6b9fc3c 100644
--- a/libarchive/archive_read_support_format_ar.c
+++ b/libarchive/archive_read_support_format_ar.c
@@ -315,7 +315,7 @@ _ar_read_header(struct archive_read *a, struct archive_entry *entry,
* If we can't look up the real name, warn and return
* the entry with the wrong name.
*/
- if (ar->strtab == NULL || number > ar->strtab_size) {
+ if (ar->strtab == NULL || number >= ar->strtab_size) {
archive_set_error(&a->archive, EINVAL,
"Can't find long filename for GNU/SVR4 archive entry");
archive_entry_copy_pathname(entry, filename);