Menu

#218 Error extracting SquashFS archive

v1.0 (example)
open
nobody
None
5
2019-01-13
2019-01-13
John Bossom
No

We have recently been using SquashFS and today I encountered a "Data error" trying to extract files using p7zip version 15.14.1... I upgraded to 16.02 and the same error occurs.
After alot of googling I discovered that the actual bug had been reported to 7zip sourceforge in 2016 along with a code snippet fix from Igor that fixes the issue (I confirmed this on the 16.02 source
for p7zip):

https://sourceforge.net/p/sevenzip/discussion/45797/thread/2fa3dbf5/
https://sourceforge.net/p/sevenzip/discussion/45797/thread/2fa3dbf5/#cd5a

p7zip has not been modified since before this bug... would it be possible to release an official patch or put out a minor source update?

Below is a contextual diff patch based upon the 7zip fix:

/ws/jebossom-ott/imageaudit_src/p7zip/p7zip_16.02/CPP/7zip/Archive/SquashfsHandler.cpp.jeb 2019-01-12 17:42:41.000000000
--- /ws/jebossom-ott/imageaudit_src/p7zip/p7zip_16.02/CPP/7zip/Archive/SquashfsHandler.cpp 2019-01-13 09:47:34.000000000
***
1059,1077
b =
src;
back = (b >> 2) + ((UInt32)src[1] << 6);
src += 2;
srcRem -= 2;
if (bOld < 32)
{
if (back == 0)
{
destLen = dest - destStart;
srcLen = src - srcStart;
return S_OK;
}
! back += ((bOld & 8) << 11) + (1 << 14) - 1;
}
}
back++;
if (len > destRem || (size_t)(dest - destStart) < back)
return S_FALSE;
destRem -= len;
--- 1059,1078 ----
b =
src;
back = (b >> 2) + ((UInt32)src[1] << 6);
src += 2;
srcRem -= 2;
if (bOld < 32)
{
+ back += ((bOld & 8) << 11);
if (back == 0)
{
destLen = dest - destStart;
srcLen = src - srcStart;
return S_OK;
}
! back += (1 << 14) - 1;
}
}
back++;
if (len > destRem || (size_t)(dest - destStart) < back)
return S_FALSE;
destRem -= len;

Best regards,

John.

Discussion


Log in to post a comment.