Skip to content

Instantly share code, notes, and snippets.

@kyprizel
Created April 22, 2020 09:59
Show Gist options
  • Select an option

  • Save kyprizel/b8e3d1df85d093404ea1dff5b79895d0 to your computer and use it in GitHub Desktop.

Select an option

Save kyprizel/b8e3d1df85d093404ea1dff5b79895d0 to your computer and use it in GitHub Desktop.
CVE-2019-16535 medum
UInt32 ICompressionCodec::decompress(const char * source, UInt32 source_size, char * dest) const
{
UInt8 method = source[0];
if (method != getMethodByte())
throw Exception("Can't decompress data with codec byte " + toString(method) + " from codec with byte " + toString(method), ErrorCodes::CANNOT_DECOMPRESS);
UInt8 header_size = getHeaderSize();
UInt32 decompressed_size = unalignedLoad<UInt32>(&source[5]);
doDecompressData(&source[header_size], source_size - header_size, dest, decompressed_size);
return decompressed_size;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment