Skip to content

Commit 66070d4

Browse files
committed
Z-1802 Gzip Input - Incorrect endianness in FEXTRA handling
1 parent a4818aa commit 66070d4

1 file changed

Lines changed: 3 additions & 2 deletions

File tree

src/GZip/GzipInputStream.cs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,8 @@
3737
// exception statement from your version.
3838

3939
// HISTORY
40-
// 11-08-2009 GeoffHart T9121 Added Multi-member gzip support
40+
// 2009-08-11 T9121 Geoff Hart Added Multi-member gzip support
41+
// 2012-06-03 Z-1802 Incorrect endianness in FEXTRA handling
4142

4243
using System;
4344
using System.IO;
@@ -279,7 +280,7 @@ bit 7 reserved
279280
headCRC.Update(len1);
280281
headCRC.Update(len2);
281282

282-
int extraLen = (len1 << 8) | len2;
283+
int extraLen = (len2 << 8) | len1; // gzip is LSB first
283284
for (int i = 0; i < extraLen;i++) {
284285
int readByte = inputBuffer.ReadLeByte();
285286
if (readByte < 0)

0 commit comments

Comments
 (0)