summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorkientzle <kientzle@FreeBSD.org>2004-06-19 04:19:27 +0000
committerkientzle <kientzle@FreeBSD.org>2004-06-19 04:19:27 +0000
commita04c1a531bb424319a7442d32c71bf3cc09289cc (patch)
treed0cd9fc7ddb7685228d9ef73836ab87b438172f4 /lib
parent04ef458020d3773ca90efb24e46cf8750413f049 (diff)
downloadFreeBSD-src-a04c1a531bb424319a7442d32c71bf3cc09289cc.zip
FreeBSD-src-a04c1a531bb424319a7442d32c71bf3cc09289cc.tar.gz
Ignore file flag bits that we don't support. In particular, this
corrects a segfault seen when archiving files from NTFS (which sets bits in st_flags that are not documented in <sys/stat.h>.) Thanks to: Doug Rabson
Diffstat (limited to 'lib')
-rw-r--r--lib/libarchive/archive_entry.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/lib/libarchive/archive_entry.c b/lib/libarchive/archive_entry.c
index 204182b..dfea3d3 100644
--- a/lib/libarchive/archive_entry.c
+++ b/lib/libarchive/archive_entry.c
@@ -1366,6 +1366,8 @@ ae_fflagstostr(unsigned long bitset, unsigned long bitclear)
bits &= ~(flag->set | flag->clear);
}
+ if (length == 0)
+ return (NULL);
string = malloc(length);
if (string == NULL)
return (NULL);
OpenPOWER on IntegriCloud