From 2a6318b8c561b86ec58368cb2cac5e1d749e8236 Mon Sep 17 00:00:00 2001 From: Armin Novak Date: Tue, 1 Sep 2015 12:05:22 +0200 Subject: [PATCH] Fixed zero length allocation. --- server/shadow/shadow_client.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/server/shadow/shadow_client.c b/server/shadow/shadow_client.c index bd0c581..fc141fb 100644 --- a/server/shadow/shadow_client.c +++ b/server/shadow/shadow_client.c @@ -713,9 +713,11 @@ int shadow_client_send_bitmap_update(rdpShadowClient* client, rdpShadowSurface* UINT32 i, j; UINT32 updateSize; UINT32 newUpdateSize; - BITMAP_DATA* fragBitmapData; + BITMAP_DATA* fragBitmapData = NULL; + + if (k > 0) + fragBitmapData = (BITMAP_DATA*) malloc(sizeof(BITMAP_DATA) * k); - fragBitmapData = (BITMAP_DATA*) malloc(sizeof(BITMAP_DATA) * k); if (!fragBitmapData) { free(bitmapData); -- 2.7.4