From 47d18566159cefd714187e9b143a6ecbd1b13781 Mon Sep 17 00:00:00 2001 From: akallabeth Date: Sun, 21 Apr 2024 10:18:43 +0200 Subject: [PATCH] fix out of bound read CVE: CVE-2024-32659 Upstream-Status: Backport [https://github.com/FreeRDP/FreeRDP/commit/6430945ce003a5e24d454d8566f54aae1b6b617b] Signed-off-by: Gyorgy Sarvari --- libfreerdp/codec/color.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/libfreerdp/codec/color.c b/libfreerdp/codec/color.c index 186d477c8..9aba6df65 100644 --- a/libfreerdp/codec/color.c +++ b/libfreerdp/codec/color.c @@ -847,6 +847,9 @@ BOOL freerdp_image_copy(BYTE* pDstData, DWORD DstFormat, UINT32 nDstStep, UINT32 if (!pDstData || !pSrcData) return FALSE; + if ((nWidth == 0) || (nHeight == 0)) + return TRUE; + if (nDstStep == 0) nDstStep = nWidth * FreeRDPGetBytesPerPixel(DstFormat);