mirror of https://github.com/FreeRDP/FreeRDP
Fix CVE-2020-11524: out of bounds access in interleaved
Thanks to Sunglin and HuanGMz from Knownsec 404
This commit is contained in:
parent
e075f348d2
commit
7b1d4b4939
|
@ -334,6 +334,9 @@ static INLINE BOOL RLEDECOMPRESS(const BYTE* pbSrcBuffer, UINT32 cbSrcBuffer, BY
|
|||
case MEGA_MEGA_COLOR_IMAGE:
|
||||
runLength = ExtractRunLength(code, pbSrc, &advance);
|
||||
pbSrc = pbSrc + advance;
|
||||
if (!ENSURE_CAPACITY(pbDest, pbDestEnd, runLength))
|
||||
return FALSE;
|
||||
|
||||
UNROLL(runLength, {
|
||||
SRCREADPIXEL(temp, pbSrc);
|
||||
SRCNEXTPIXEL(pbSrc);
|
||||
|
|
|
@ -215,7 +215,7 @@ static INLINE BOOL ensure_capacity(const BYTE* start, const BYTE* end, size_t si
|
|||
{
|
||||
const size_t available = (uintptr_t)end - (uintptr_t)start;
|
||||
const BOOL rc = available >= size * base;
|
||||
return rc;
|
||||
return rc && (start <= end);
|
||||
}
|
||||
|
||||
static INLINE void write_pixel_8(BYTE* _buf, BYTE _pix)
|
||||
|
|
Loading…
Reference in New Issue