diff --git a/client/X11/xf_gdi.c b/client/X11/xf_gdi.c index ef06b350d..99a7f314d 100644 --- a/client/X11/xf_gdi.c +++ b/client/X11/xf_gdi.c @@ -1065,7 +1065,7 @@ static BOOL xf_gdi_surface_bits(rdpContext* context, format = gdi_get_pixel_format(cmd->bpp); if (!freerdp_image_copy(gdi->primary_buffer, gdi->dstFormat, gdi->stride, - 0, 0, cmd->width, cmd->height, + cmd->destLeft, cmd->destTop, cmd->width, cmd->height, pSrcData, format, 0, 0, 0, &xfc->context.gdi->palette, FREERDP_FLIP_VERTICAL)) goto fail; diff --git a/libfreerdp/core/gcc.c b/libfreerdp/core/gcc.c index ae26115ab..87466db21 100644 --- a/libfreerdp/core/gcc.c +++ b/libfreerdp/core/gcc.c @@ -1471,6 +1471,10 @@ BOOL gcc_write_server_security_data(wStream* s, rdpMcs* mcs) Stream_Write_UINT32(s, serverCertLen); /* serverCertLen */ settings->ServerRandomLength = serverRandomLen; settings->ServerRandom = (BYTE*) malloc(serverRandomLen); + if (!settings->ServerRandom) + { + return FALSE; + } winpr_RAND(settings->ServerRandom, serverRandomLen); Stream_Write(s, settings->ServerRandom, serverRandomLen); sigData = Stream_Pointer(s);