client/X11: Check arguments in xf_Bitmap_SetSurface

Arguments of xf_Bitmap_SetSurface are not checked before use currently
which may lead to segfaults. It may happen if bitmap is not found in a
cache from some reason. Let's check the arguments before use similarly
as it is done in client/Windows/wf_graphics.c in order to avoid segfaults.

https://github.com/FreeRDP/FreeRDP/issues/4117
This commit is contained in:
Ondrej Holy 2017-09-04 18:22:49 +02:00
parent 3b8352690e
commit 4239660e34
1 changed files with 4 additions and 0 deletions

View File

@ -202,6 +202,10 @@ static BOOL xf_Bitmap_SetSurface(rdpContext* context, rdpBitmap* bitmap,
BOOL primary)
{
xfContext* xfc = (xfContext*) context;
if (!context || (!bitmap && !primary))
return FALSE;
xf_lock_x11(xfc, FALSE);
if (primary)