Skip to content

Commit

Permalink
Merge pull request #18707 from ghalliday/issue31956
Browse files Browse the repository at this point in the history
HPCC-31956 Better error recovery when downgrading systems

Reviewed-By: Richard Chapman <[email protected]>
Merged-by: Gavin Halliday <[email protected]>
  • Loading branch information
ghalliday authored May 31, 2024
2 parents 1b8e41a + f5df9cc commit 0a65a5f
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions system/jlib/jlzw.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -804,10 +804,13 @@ void decompressToBuffer(MemoryBuffer & out, const void * src)

void decompressToBuffer(MemoryBuffer & out, MemoryBuffer & in)
{
bool compressed;
unsigned char method;
size32_t srcLen;
in.read(compressed).read(srcLen);
if (compressed)
in.read(method).read(srcLen);
if (method > 1)
throw makeStringException(-1, "New compression format is not supported in this version");

if (method != 0)
decompressToBuffer(out, in.readDirect(srcLen));
else
out.append(srcLen, in.readDirect(srcLen));
Expand Down

0 comments on commit 0a65a5f

Please sign in to comment.