[PATCH] Fix compile error in mscat

Andreas Schneider asn at samba.org
Fri Jan 18 12:18:45 UTC 2019


Hi,

attached is a small patch to address -Wmaybe-uninitialized issues.

Review appreciated.


Thanks,


	Andreas

-- 
Andreas Schneider                      asn at samba.org
Samba Team                             www.samba.org
GPG-ID:     8DFF53E18F2ABC8D8F3C92237EE0FC4DCC014E3D
-------------- next part --------------
>From c2df5c56310497d66838fadc91460e47b7e15212 Mon Sep 17 00:00:00 2001
From: Andreas Schneider <asn at samba.org>
Date: Fri, 18 Jan 2019 13:11:38 +0100
Subject: [PATCH] lib:mscat: Fix may be used uninitialized warnings

Signed-off-by: Andreas Schneider <asn at samba.org>
---
 lib/mscat/mscat_pkcs7.c | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/lib/mscat/mscat_pkcs7.c b/lib/mscat/mscat_pkcs7.c
index 55944232205..d606a86f095 100644
--- a/lib/mscat/mscat_pkcs7.c
+++ b/lib/mscat/mscat_pkcs7.c
@@ -121,7 +121,9 @@ int mscat_pkcs7_import_catfile(struct mscat_pkcs7 *mp7,
 	gnutls_datum_t mscat_data = {
 		.size = 0,
 	};
-	DATA_BLOB blob;
+	DATA_BLOB blob = {
+		.length = 0,
+	};
 	int rc;
 
 	tmp_ctx = talloc_new(mp7);
@@ -164,7 +166,9 @@ int mscat_pkcs7_verify(struct mscat_pkcs7 *mp7,
 	TALLOC_CTX *tmp_ctx = NULL;
 	gnutls_x509_trust_list_t tl = NULL;
 	gnutls_datum_t ca_data;
-	DATA_BLOB blob;
+	DATA_BLOB blob = {
+		.length = 0,
+	};
 	uint32_t flags = 0;
 	const char *oid;
 	int count;
-- 
2.20.1



More information about the samba-technical mailing list