884a19
From 0bd36d040129f511762b89555d98851a9dcaf3f6 Mon Sep 17 00:00:00 2001
884a19
From: Andreas Schneider <asn@samba.org>
884a19
Date: Mon, 12 Nov 2018 10:09:23 +0100
884a19
Subject: [PATCH 1/5] s3:rpcclient: Initialize domain_name
884a19
884a19
This could be passed uninitialized to dcerpc_netr_DsRGetDCName()
884a19
884a19
Found by cppcheck.
884a19
884a19
BUG: https://bugzilla.samba.org/show_bug.cgi?id=13680
884a19
884a19
Signed-off-by: Andreas Schneider <asn@samba.org>
884a19
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
884a19
(cherry picked from commit 56ac8944eb58f234422b4bd4dd9a64b8e51e874d)
884a19
---
884a19
 source3/rpcclient/cmd_netlogon.c | 2 +-
884a19
 1 file changed, 1 insertion(+), 1 deletion(-)
884a19
884a19
diff --git a/source3/rpcclient/cmd_netlogon.c b/source3/rpcclient/cmd_netlogon.c
884a19
index 8d62ef7e095..631740562c6 100644
884a19
--- a/source3/rpcclient/cmd_netlogon.c
884a19
+++ b/source3/rpcclient/cmd_netlogon.c
884a19
@@ -216,7 +216,7 @@ static WERROR cmd_netlogon_dsr_getdcname(struct rpc_pipe_client *cli,
884a19
	WERROR werr = WERR_OK;
884a19
	uint32_t flags = DS_RETURN_DNS_NAME;
884a19
	const char *server_name = cli->desthost;
884a19
-	const char *domain_name;
884a19
+	const char *domain_name = NULL;
884a19
	struct GUID domain_guid = GUID_zero();
884a19
	struct GUID site_guid = GUID_zero();
884a19
	struct netr_DsRGetDCNameInfo *info = NULL;
884a19
--
884a19
2.19.2
884a19
884a19
884a19
From f14942265b08710d4e9bf6b17219f65b5ea79e01 Mon Sep 17 00:00:00 2001
884a19
From: Andreas Schneider <asn@samba.org>
884a19
Date: Mon, 12 Nov 2018 10:13:51 +0100
884a19
Subject: [PATCH 2/5] librpc:ndr: Initialize inblob
884a19
884a19
Found by cppcheck.
884a19
884a19
BUG: https://bugzilla.samba.org/show_bug.cgi?id=13680
884a19
884a19
Signed-off-by: Andreas Schneider <asn@samba.org>
884a19
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
884a19
(cherry picked from commit 9c37ed26f0a814f77c934ae190f48d0a1e673f83)
884a19
---
884a19
 librpc/ndr/ndr_backupkey.c | 4 +++-
884a19
 1 file changed, 3 insertions(+), 1 deletion(-)
884a19
884a19
diff --git a/librpc/ndr/ndr_backupkey.c b/librpc/ndr/ndr_backupkey.c
884a19
index 827bc694230..adb6e393287 100644
884a19
--- a/librpc/ndr/ndr_backupkey.c
884a19
+++ b/librpc/ndr/ndr_backupkey.c
884a19
@@ -58,7 +58,9 @@ _PUBLIC_ void ndr_print_bkrp_BackupKey(struct ndr_print *ndr, const char *name,
884a19
		ndr->flags |= LIBNDR_PRINT_SET_VALUES;
884a19
	}
884a19
	if (flags & NDR_IN) {
884a19
-		union bkrp_data_in_blob inblob;
884a19
+		union bkrp_data_in_blob inblob = {
884a19
+			.empty._empty_ = '\0',
884a19
+		};
884a19
		DATA_BLOB blob;
884a19
		uint32_t level;
884a19
		enum ndr_err_code ndr_err;
884a19
--
884a19
2.19.2
884a19
884a19
884a19
From 865ad3bb69c487589f24c755b2082fe51e5a261a Mon Sep 17 00:00:00 2001
884a19
From: Andreas Schneider <asn@samba.org>
884a19
Date: Mon, 12 Nov 2018 10:16:06 +0100
884a19
Subject: [PATCH 3/5] libgpo: Make sure status is intialized
884a19
884a19
Found by cppcheck.
884a19
884a19
BUG: https://bugzilla.samba.org/show_bug.cgi?id=13680
884a19
884a19
Signed-off-by: Andreas Schneider <asn@samba.org>
884a19
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
884a19
(cherry picked from commit 159f753732cdc1e4491f93617779861fb9d73bc7)
884a19
---
884a19
 libgpo/gpo_ldap.c | 2 +-
884a19
 1 file changed, 1 insertion(+), 1 deletion(-)
884a19
884a19
diff --git a/libgpo/gpo_ldap.c b/libgpo/gpo_ldap.c
884a19
index fec00053b49..f087203f28a 100644
884a19
--- a/libgpo/gpo_ldap.c
884a19
+++ b/libgpo/gpo_ldap.c
884a19
@@ -474,7 +474,7 @@ ADS_STATUS ads_get_gpo(ADS_STRUCT *ads,
884a19
		       const char *guid_name,
884a19
		       struct GROUP_POLICY_OBJECT *gpo)
884a19
 {
884a19
-	ADS_STATUS status;
884a19
+	ADS_STATUS status = ADS_ERROR(LDAP_NO_SUCH_OBJECT);
884a19
	LDAPMessage *res = NULL;
884a19
	char *dn;
884a19
	const char *filter;
884a19
--
884a19
2.19.2
884a19
884a19
884a19
From b40b21c5b2f6ed6e4e123cb55d9279f88b3e5c3b Mon Sep 17 00:00:00 2001
884a19
From: Andreas Schneider <asn@samba.org>
884a19
Date: Mon, 12 Nov 2018 10:17:37 +0100
884a19
Subject: [PATCH 4/5] lib:util Always initialize start and space
884a19
884a19
Found by cppcheck.
884a19
884a19
BUG: https://bugzilla.samba.org/show_bug.cgi?id=13680
884a19
884a19
Signed-off-by: Andreas Schneider <asn@samba.org>
884a19
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
884a19
(cherry picked from commit 050d1e7d53c068efac109ec4ff7a686d152e6a45)
884a19
---
884a19
 lib/util/talloc_report.c | 7 ++-----
884a19
 1 file changed, 2 insertions(+), 5 deletions(-)
884a19
884a19
diff --git a/lib/util/talloc_report.c b/lib/util/talloc_report.c
884a19
index 63213a014b6..bed0fd91e43 100644
884a19
--- a/lib/util/talloc_report.c
884a19
+++ b/lib/util/talloc_report.c
884a19
@@ -33,8 +33,8 @@ static char *talloc_vasprintf_append_largebuf(char *buf, ssize_t *pstr_len,
884a19
					      const char *fmt, va_list ap)
884a19
 {
884a19
	ssize_t str_len = *pstr_len;
884a19
-	size_t buflen, needed, space;
884a19
-	char *start, *tmpbuf;
884a19
+	size_t buflen, needed, space = 0;
884a19
+	char *start = NULL, *tmpbuf = NULL;
884a19
	va_list ap2;
884a19
	int printlen;
884a19
884a19
@@ -52,9 +52,6 @@ static char *talloc_vasprintf_append_largebuf(char *buf, ssize_t *pstr_len,
884a19
	if (buflen > str_len) {
884a19
		start = buf + str_len;
884a19
		space = buflen - str_len;
884a19
-	} else {
884a19
-		start = NULL;
884a19
-		space = 0;
884a19
	}
884a19
884a19
	va_copy(ap2, ap);
884a19
--
884a19
2.19.2
884a19
884a19
884a19
From 01c2b8c1920744b9b46e3b2010f0487f23aa865b Mon Sep 17 00:00:00 2001
884a19
From: Andreas Schneider <asn@samba.org>
884a19
Date: Mon, 12 Nov 2018 10:21:15 +0100
884a19
Subject: [PATCH 5/5] ctdb: Fix an out of bound array access
884a19
884a19
Found by cppcheck.
884a19
884a19
BUG: https://bugzilla.samba.org/show_bug.cgi?id=13680
884a19
884a19
Signed-off-by: Andreas Schneider <asn@samba.org>
884a19
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
884a19
(cherry picked from commit 008b9652cacdfd99e68db9d88f4e0c33eefa87e9)
884a19
---
884a19
 ctdb/common/logging.c | 2 +-
884a19
 1 file changed, 1 insertion(+), 1 deletion(-)
884a19
884a19
diff --git a/ctdb/common/logging.c b/ctdb/common/logging.c
884a19
index dc8c4f75058..55e5d541735 100644
884a19
--- a/ctdb/common/logging.c
884a19
+++ b/ctdb/common/logging.c
884a19
@@ -85,7 +85,7 @@ const char *debug_level_to_string(int log_level)
884a19
 {
884a19
	int i;
884a19
884a19
-	for (i=0; ARRAY_SIZE(log_string_map); i++) {
884a19
+	for (i=0; i < ARRAY_SIZE(log_string_map); i++) {
884a19
		if (log_string_map[i].log_level == log_level) {
884a19
			return log_string_map[i].log_string;
884a19
		}
884a19
--
884a19
2.19.2