Skip to content

Commit

Permalink
HPCC-31956 Better error recovery when downgrading systems
Browse files Browse the repository at this point in the history
Signed-off-by: Gavin Halliday <[email protected]>
  • Loading branch information
ghalliday committed May 29, 2024
1 parent 1b8e41a commit f5df9cc
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 f5df9cc

Please sign in to comment.