From b51a103b70178e0d481eb1f929d6ce8cd2992e93 Mon Sep 17 00:00:00 2001 From: Armin Novak Date: Thu, 13 Jul 2017 12:19:10 +0200 Subject: [PATCH] Fixed uninitialized values. --- client/X11/xf_cliprdr.c | 5 +---- libfreerdp/core/certificate.c | 5 +++++ libfreerdp/primitives/test/TestPrimitivesYCbCr.c | 2 +- 3 files changed, 7 insertions(+), 5 deletions(-) diff --git a/client/X11/xf_cliprdr.c b/client/X11/xf_cliprdr.c index e87607ec9..e47138591 100644 --- a/client/X11/xf_cliprdr.c +++ b/client/X11/xf_cliprdr.c @@ -1603,8 +1603,7 @@ static UINT xf_cliprdr_clipboard_file_range_failure(wClipboardDelegate* delegate xfClipboard* xf_clipboard_new(xfContext* xfc) { - int i; - int n; + int i, n = 0; rdpChannels* channels; xfClipboard* clipboard; @@ -1664,8 +1663,6 @@ xfClipboard* xf_clipboard_new(xfContext* xfc) "Warning: Using clipboard redirection without XFIXES extension is strongly discouraged!"); #endif - n = 0; - clipboard->clientFormats[n].atom = XInternAtom(xfc->display, "_FREERDP_RAW", False); clipboard->clientFormats[n].formatId = CF_RAW; n++; diff --git a/libfreerdp/core/certificate.c b/libfreerdp/core/certificate.c index 620bbc980..f8f7ed4b6 100644 --- a/libfreerdp/core/certificate.c +++ b/libfreerdp/core/certificate.c @@ -167,6 +167,11 @@ BOOL certificate_read_x509_certificate(rdpCertBlob* cert, rdpCertInfo* info) int exponent_length; int error = 0; + if (!cert || !info) + return FALSE; + + memset(info, 0, sizeof(rdpCertInfo)); + s = Stream_New(cert->data, cert->length); if (!s) diff --git a/libfreerdp/primitives/test/TestPrimitivesYCbCr.c b/libfreerdp/primitives/test/TestPrimitivesYCbCr.c index 050ac6475..7c28d8a4f 100644 --- a/libfreerdp/primitives/test/TestPrimitivesYCbCr.c +++ b/libfreerdp/primitives/test/TestPrimitivesYCbCr.c @@ -2162,7 +2162,7 @@ static int test_PrimitivesYCbCr(const primitives_t* prims, UINT32 format, prim_s BYTE* actual1; BYTE* expected; int margin = 1; - INT16* pYCbCr[3]; + INT16* pYCbCr[3] = { NULL, NULL, NULL }; const UINT32 srcStride = roi.width * 2; const UINT32 dstStride = roi.width * GetBytesPerPixel(format); const UINT32 srcSize = srcStride * roi.height;