e5b36c
diff -up openchange-openchange-2.3-VULCAN/libmapiadmin/mapiadmin_user.c.samba-4.10-macros openchange-openchange-2.3-VULCAN/libmapiadmin/mapiadmin_user.c
e5b36c
--- openchange-openchange-2.3-VULCAN/libmapiadmin/mapiadmin_user.c.samba-4.10-macros	2019-02-14 15:19:53.317769411 +0100
e5b36c
+++ openchange-openchange-2.3-VULCAN/libmapiadmin/mapiadmin_user.c	2019-02-14 15:19:53.331769410 +0100
e5b36c
@@ -39,6 +39,8 @@
e5b36c
 
e5b36c
 #include <time.h>
e5b36c
 
e5b36c
+#include "libmapi/libmapi_private.h"
e5b36c
+
e5b36c
 static ssize_t openchange_sys_read(int fd, void *buf, size_t count)
e5b36c
 {
e5b36c
 	ssize_t ret;
e5b36c
@@ -101,7 +103,7 @@ static enum ndr_err_code openchange_ndr_
e5b36c
 		NDR_CHECK(ndr_push_uint8(ndr, NDR_SCALARS, r->sid_rev_num));
e5b36c
 		NDR_CHECK(ndr_push_int8(ndr, NDR_SCALARS, r->num_auths));
e5b36c
 		NDR_CHECK(ndr_push_array_uint8(ndr, NDR_SCALARS, r->id_auth, 6));
e5b36c
-		if (r->num_auths < 0 || r->num_auths > ARRAY_SIZE(r->sub_auths)) {
e5b36c
+		if (r->num_auths < 0 || r->num_auths > OC_ARRAY_SIZE(r->sub_auths)) {
e5b36c
 			return ndr_push_error(ndr, NDR_ERR_RANGE, "value out of range");
e5b36c
 		}
e5b36c
 		for (cntr_sub_auths_0 = 0; cntr_sub_auths_0 < r->num_auths; cntr_sub_auths_0++) {
e5b36c
@@ -659,7 +661,7 @@ again:
e5b36c
 
e5b36c
 	OC_DEBUG(3, "Setting account password '%s'", mapiadmin_ctx->password);
e5b36c
 
e5b36c
-	ZERO_STRUCT(u);
e5b36c
+	OC_ZERO_STRUCT(u);
e5b36c
 	s.in.user_handle = &mapiadmin_ctx->user_ctx->user_handle;
e5b36c
 	s.in.info = &u;
e5b36c
 	s.in.level = 24;
e5b36c
@@ -687,7 +689,7 @@ again:
e5b36c
 		}
e5b36c
 	}
e5b36c
 
e5b36c
-	ZERO_STRUCT(u);
e5b36c
+	OC_ZERO_STRUCT(u);
e5b36c
 	s.in.user_handle = &mapiadmin_ctx->user_ctx->user_handle;
e5b36c
 	s.in.info = &u;
e5b36c
 	s.in.level = 21;
e5b36c
diff -up openchange-openchange-2.3-VULCAN/libmapi/libmapi_private.h.samba-4.10-macros openchange-openchange-2.3-VULCAN/libmapi/libmapi_private.h
e5b36c
--- openchange-openchange-2.3-VULCAN/libmapi/libmapi_private.h.samba-4.10-macros	2019-02-14 15:19:53.313769411 +0100
e5b36c
+++ openchange-openchange-2.3-VULCAN/libmapi/libmapi_private.h	2019-02-14 15:19:53.331769410 +0100
e5b36c
@@ -141,6 +141,11 @@ const char		*libmapi_iface_best_ip(struc
e5b36c
 bool			libmapi_iface_is_local(struct interface *, const char *);
e5b36c
 bool			libmapi_iface_same_net(const char *, const char *, const char *);
e5b36c
 
e5b36c
+#define OC_ZERO_STRUCT(x) memset((char *)&(x), 0, sizeof(x))
e5b36c
+#define OC_ZERO_STRUCTP(x) do { if ((x) != NULL) memset((char *)(x), 0, sizeof(*(x))); } while(0)
e5b36c
+#define OC_ZERO_STRUCTPN(x) memset((char *)(x), 0, sizeof(*(x)))
e5b36c
+#define OC_ARRAY_SIZE(a) (sizeof(a)/sizeof(a[0]))
e5b36c
+
e5b36c
 __END_DECLS
e5b36c
 
e5b36c
 #undef _PRINTF_ATTRIBUTE
e5b36c
diff -up openchange-openchange-2.3-VULCAN/libmapi/socket/interface.c.samba-4.10-macros openchange-openchange-2.3-VULCAN/libmapi/socket/interface.c
e5b36c
--- openchange-openchange-2.3-VULCAN/libmapi/socket/interface.c.samba-4.10-macros	2019-02-14 15:19:53.318769411 +0100
e5b36c
+++ openchange-openchange-2.3-VULCAN/libmapi/socket/interface.c	2019-02-14 15:19:53.331769410 +0100
e5b36c
@@ -70,7 +70,7 @@ static void add_interface(TALLOC_CTX *me
e5b36c
 	if (iface == NULL) 
e5b36c
 		return;
e5b36c
 	
e5b36c
-	ZERO_STRUCTPN(iface);
e5b36c
+	OC_ZERO_STRUCTPN(iface);
e5b36c
 
e5b36c
 	iface->ip = ip;
e5b36c
 	iface->nmask = nmask;
e5b36c
diff -up openchange-openchange-2.3-VULCAN/mapiproxy/dcesrv_mapiproxy.c.samba-4.10-macros openchange-openchange-2.3-VULCAN/mapiproxy/dcesrv_mapiproxy.c
e5b36c
--- openchange-openchange-2.3-VULCAN/mapiproxy/dcesrv_mapiproxy.c.samba-4.10-macros	2015-05-16 17:22:04.000000000 +0200
e5b36c
+++ openchange-openchange-2.3-VULCAN/mapiproxy/dcesrv_mapiproxy.c	2019-02-14 15:19:53.331769410 +0100
e5b36c
@@ -703,7 +703,7 @@ NTSTATUS dcerpc_server_mapiproxy_init(vo
e5b36c
 	NTSTATUS			ret;
e5b36c
 	struct dcesrv_endpoint_server	ep_server;
e5b36c
 
e5b36c
-	ZERO_STRUCT(ep_server);
e5b36c
+	OC_ZERO_STRUCT(ep_server);
e5b36c
 
e5b36c
 	/* Fill in our name */
e5b36c
 	ep_server.name = "mapiproxy";
e5b36c
diff -up openchange-openchange-2.3-VULCAN/ndr_mapi.c.samba-4.10-macros openchange-openchange-2.3-VULCAN/ndr_mapi.c
e5b36c
--- openchange-openchange-2.3-VULCAN/ndr_mapi.c.samba-4.10-macros	2019-02-14 15:19:53.329769410 +0100
e5b36c
+++ openchange-openchange-2.3-VULCAN/ndr_mapi.c	2019-02-14 15:19:53.331769410 +0100
e5b36c
@@ -921,7 +921,7 @@ _PUBLIC_ enum ndr_err_code ndr_pull_EcDo
e5b36c
 	TALLOC_CTX *_mem_save_length_0;
e5b36c
 
e5b36c
 	if (flags & NDR_IN) {
e5b36c
-		ZERO_STRUCT(r->out);
e5b36c
+		OC_ZERO_STRUCT(r->out);
e5b36c
 
e5b36c
 		if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) {
e5b36c
 			NDR_PULL_ALLOC(ndr, r->in.handle);
e5b36c
@@ -961,7 +961,7 @@ _PUBLIC_ enum ndr_err_code ndr_pull_EcDo
e5b36c
 		NDR_PULL_ALLOC(ndr, r->out.handle);
e5b36c
 		*r->out.handle = *r->in.handle;
e5b36c
 		NDR_PULL_ALLOC(ndr, r->out.mapi_response);
e5b36c
-		ZERO_STRUCTP(r->out.mapi_response);
e5b36c
+		OC_ZERO_STRUCTP(r->out.mapi_response);
e5b36c
 		NDR_PULL_ALLOC(ndr, r->out.length);
e5b36c
 		*r->out.length = *r->in.length;
e5b36c
 	}
e5b36c
@@ -1235,7 +1235,7 @@ _PUBLIC_ enum ndr_err_code ndr_pull_EcDo
e5b36c
 	TALLOC_CTX	*_mem_save_rgbAuxOut_1;
e5b36c
 
e5b36c
 	if (flags & NDR_IN) {
e5b36c
-		ZERO_STRUCT(r->out);
e5b36c
+		OC_ZERO_STRUCT(r->out);
e5b36c
 
e5b36c
 		NDR_CHECK(ndr_pull_array_size(ndr, &r->in.szUserDN));
e5b36c
 		NDR_CHECK(ndr_pull_array_length(ndr, &r->in.szUserDN));
e5b36c
@@ -1294,19 +1294,19 @@ _PUBLIC_ enum ndr_err_code ndr_pull_EcDo
e5b36c
 		}
e5b36c
 		NDR_PULL_SET_MEM_CTX(ndr, _mem_save_pcbAuxOut_0, LIBNDR_FLAG_REF_ALLOC);
e5b36c
 		NDR_PULL_ALLOC(ndr, r->out.handle);
e5b36c
-		ZERO_STRUCTP(r->out.handle);
e5b36c
+		OC_ZERO_STRUCTP(r->out.handle);
e5b36c
 		NDR_PULL_ALLOC(ndr, r->out.pcmsPollsMax);
e5b36c
-		ZERO_STRUCTP(r->out.pcmsPollsMax);
e5b36c
+		OC_ZERO_STRUCTP(r->out.pcmsPollsMax);
e5b36c
 		NDR_PULL_ALLOC(ndr, r->out.pcRetry);
e5b36c
-		ZERO_STRUCTP(r->out.pcRetry);
e5b36c
+		OC_ZERO_STRUCTP(r->out.pcRetry);
e5b36c
 		NDR_PULL_ALLOC(ndr, r->out.pcmsRetryDelay);
e5b36c
-		ZERO_STRUCTP(r->out.pcmsRetryDelay);
e5b36c
+		OC_ZERO_STRUCTP(r->out.pcmsRetryDelay);
e5b36c
 		NDR_PULL_ALLOC(ndr, r->out.picxr);
e5b36c
-		ZERO_STRUCTP(r->out.picxr);
e5b36c
+		OC_ZERO_STRUCTP(r->out.picxr);
e5b36c
 		NDR_PULL_ALLOC(ndr, r->out.szDNPrefix);
e5b36c
-		ZERO_STRUCTP(r->out.szDNPrefix);
e5b36c
+		OC_ZERO_STRUCTP(r->out.szDNPrefix);
e5b36c
 		NDR_PULL_ALLOC(ndr, r->out.szDisplayName);
e5b36c
-		ZERO_STRUCTP(r->out.szDisplayName);
e5b36c
+		OC_ZERO_STRUCTP(r->out.szDisplayName);
e5b36c
 		NDR_PULL_ALLOC(ndr, r->out.pulTimeStamp);
e5b36c
 		*r->out.pulTimeStamp = *r->in.pulTimeStamp;
e5b36c
 		NDR_PULL_ALLOC(ndr, r->out.pcbAuxOut);
e5b36c
diff -up openchange-openchange-2.3-VULCAN/testsuite/libmapi/mapi_property.c.samba-4.10-macros openchange-openchange-2.3-VULCAN/testsuite/libmapi/mapi_property.c
e5b36c
--- openchange-openchange-2.3-VULCAN/testsuite/libmapi/mapi_property.c.samba-4.10-macros	2015-05-16 17:22:04.000000000 +0200
e5b36c
+++ openchange-openchange-2.3-VULCAN/testsuite/libmapi/mapi_property.c	2019-02-14 15:19:53.331769410 +0100
e5b36c
@@ -280,7 +280,7 @@ static void _make_test_srow(TALLOC_CTX *
e5b36c
 {
e5b36c
 	struct SPropValue prop_val;
e5b36c
 
e5b36c
-	ZERO_STRUCT(prop_val);
e5b36c
+	OC_ZERO_STRUCT(prop_val);
e5b36c
 	/* PT_I8 */
e5b36c
 	prop_val.ulPropTag = PR_FID;
e5b36c
 	prop_val.value.d = 0x0123456789ABCDEFul;
e5b36c
diff -up openchange-openchange-2.3-VULCAN/testsuite/libmapiproxy/openchangedb_logger.c.samba-4.10-macros openchange-openchange-2.3-VULCAN/testsuite/libmapiproxy/openchangedb_logger.c
e5b36c
--- openchange-openchange-2.3-VULCAN/testsuite/libmapiproxy/openchangedb_logger.c.samba-4.10-macros	2015-05-16 17:22:04.000000000 +0200
e5b36c
+++ openchange-openchange-2.3-VULCAN/testsuite/libmapiproxy/openchangedb_logger.c	2019-02-14 15:19:53.332769410 +0100
e5b36c
@@ -638,7 +638,7 @@ static void ocdb_logger_setup(void)
e5b36c
 		ck_abort();
e5b36c
 	}
e5b36c
 
e5b36c
-	ZERO_STRUCT(functions_called);
e5b36c
+	OC_ZERO_STRUCT(functions_called);
e5b36c
 }
e5b36c
 
e5b36c
 static void ocdb_logger_teardown(void)