diff options
author | kientzle <kientzle@FreeBSD.org> | 2005-03-13 02:35:52 +0000 |
---|---|---|
committer | kientzle <kientzle@FreeBSD.org> | 2005-03-13 02:35:52 +0000 |
commit | 57f747801246faa8e85b3cbaac2f8631bef0cfaa (patch) | |
tree | f2ca6fb775115d9c610f92a8cad203ca101c7b85 /lib | |
parent | 347e70d823a70c962eb17139c00f55296e50110a (diff) | |
download | FreeBSD-src-57f747801246faa8e85b3cbaac2f8631bef0cfaa.zip FreeBSD-src-57f747801246faa8e85b3cbaac2f8631bef0cfaa.tar.gz |
When rejecting rediculously large pax attributes (such as pathnames
over 1MB), issue a warning instead of forcing an internal assertion
failure.
Diffstat (limited to 'lib')
-rw-r--r-- | lib/libarchive/archive_read_support_format_tar.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/lib/libarchive/archive_read_support_format_tar.c b/lib/libarchive/archive_read_support_format_tar.c index 1c22763..1db3e8f 100644 --- a/lib/libarchive/archive_read_support_format_tar.c +++ b/lib/libarchive/archive_read_support_format_tar.c @@ -1020,8 +1020,11 @@ pax_header(struct archive *a, struct tar *tar, struct archive_entry *entry, return (-1); line_length *= 10; line_length += *p - '0'; - if (line_length > 999999) - return (-1); + if (line_length > 999999) { + archive_set_error(a, ARCHIVE_ERRNO_MISC, + "Rejecting pax extended attribute > 1MB"); + return (ARCHIVE_WARN); + } p++; l--; } |