From 84875e4d6f5a2926d0858cac3510ab7a3d87e358 Mon Sep 17 00:00:00 2001 From: Tim Kientzle Date: Wed, 2 Mar 2005 05:34:05 +0000 Subject: [PATCH] Use correct byte order when parsing the size of the gzip "Extra data" field. In particular, this correctly allows bsdtar (and pkg_add) to skip package signatures. Thanks to: Theo Schlossnagle --- lib/libarchive/archive_read_support_compression_gzip.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/libarchive/archive_read_support_compression_gzip.c b/lib/libarchive/archive_read_support_compression_gzip.c index 50da5ba9158b..8a80866feac0 100644 --- a/lib/libarchive/archive_read_support_compression_gzip.c +++ b/lib/libarchive/archive_read_support_compression_gzip.c @@ -426,7 +426,7 @@ drive_decompressor(struct archive *a, struct private_data *state) */ case 11: /* Optional Extra: Second byte of Length. */ if ((flags & 4)) { - count = (count << 8) | (255 & (int)b); + count = (0xff00 & ((int)b << 8)) | count; header_state = 12; break; }