Merge pull request #2055 from dbungert/initialize

Fix multiple cases of use of uninitialized vars
This commit is contained in:
Marc-André Moreau 2014-09-05 14:51:43 -04:00
commit dc56ad7a0e
4 changed files with 14 additions and 3 deletions

View File

@ -114,6 +114,8 @@ void xf_SendClientEvent(xfContext *xfc, xfWindow *window, Atom atom, unsigned in
unsigned int i; unsigned int i;
va_list argp; va_list argp;
va_start(argp, numArgs); va_start(argp, numArgs);
ZeroMemory(&xevent, sizeof(XEvent));
xevent.xclient.type = ClientMessage; xevent.xclient.type = ClientMessage;
xevent.xclient.serial = 0; xevent.xclient.serial = 0;
xevent.xclient.send_event = False; xevent.xclient.send_event = False;

View File

@ -37,7 +37,8 @@ rdpBitmap* Bitmap_Alloc(rdpContext* context)
if (bitmap) if (bitmap)
{ {
CopyMemory(bitmap, context->graphics->Bitmap_Prototype, sizeof(rdpBitmap)); ZeroMemory(bitmap, graphics->Bitmap_Prototype->size);
CopyMemory(bitmap, graphics->Bitmap_Prototype, sizeof(rdpBitmap));
bitmap->data = NULL; bitmap->data = NULL;
} }
@ -99,7 +100,8 @@ rdpPointer* Pointer_Alloc(rdpContext* context)
if (pointer) if (pointer)
{ {
CopyMemory(pointer, context->graphics->Pointer_Prototype, sizeof(rdpPointer)); ZeroMemory(pointer, graphics->Pointer_Prototype->size);
CopyMemory(pointer, graphics->Pointer_Prototype, sizeof(rdpPointer));
} }
return pointer; return pointer;
@ -165,7 +167,8 @@ rdpGlyph* Glyph_Alloc(rdpContext* context)
if (glyph) if (glyph)
{ {
CopyMemory(glyph, context->graphics->Glyph_Prototype, sizeof(rdpGlyph)); ZeroMemory(glyph, graphics->Glyph_Prototype->size);
CopyMemory(glyph, graphics->Glyph_Prototype, sizeof(rdpGlyph));
} }
return glyph; return glyph;

View File

@ -184,6 +184,9 @@ static int peer_recv_tpkt_pdu(freerdp_peer* client, wStream* s)
return -1; return -1;
} }
if (rdp->disconnect)
return 0;
if (rdp->settings->DisableEncryption) if (rdp->settings->DisableEncryption)
{ {
if (!rdp_read_security_header(s, &securityFlags)) if (!rdp_read_security_header(s, &securityFlags))

View File

@ -989,6 +989,9 @@ static int rdp_recv_tpkt_pdu(rdpRdp* rdp, wStream* s)
return -1; return -1;
} }
if (rdp->disconnect)
return 0;
if (rdp->settings->DisableEncryption) if (rdp->settings->DisableEncryption)
{ {
if (!rdp_read_security_header(s, &securityFlags)) if (!rdp_read_security_header(s, &securityFlags))