From 9cccd4888d080fc5570ec11abcc1eea53c06f579 Mon Sep 17 00:00:00 2001 From: Ondrej Holy Date: Tue, 5 Sep 2017 09:56:00 +0200 Subject: [PATCH] orders: Fix OFFSCREEN_DELETE_LIST allocation size The size of OFFSCREEN_DELETE_LIST list allocation was incorrectly changed by commit 99b1481 and consequently fixed incorrectly by commit 8a0fe086. Let's count the allocation size based on new size and not based on current size in order to prevent some memory issues. https://github.com/FreeRDP/FreeRDP/issues/4117 --- libfreerdp/core/orders.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libfreerdp/core/orders.c b/libfreerdp/core/orders.c index 6c92ce5..8427c7e 100644 --- a/libfreerdp/core/orders.c +++ b/libfreerdp/core/orders.c @@ -2460,7 +2460,7 @@ static BOOL update_read_create_offscreen_bitmap_order(wStream* s, if (deleteList->cIndices > deleteList->sIndices) { UINT16* new_indices; - new_indices = (UINT16*)realloc(deleteList->indices, deleteList->sIndices * 2); + new_indices = (UINT16*)realloc(deleteList->indices, deleteList->cIndices * 2); if (!new_indices) return FALSE; -- 2.7.4