summaryrefslogtreecommitdiff
path: root/source4/libcli/ndr
diff options
context:
space:
mode:
Diffstat (limited to 'source4/libcli/ndr')
-rw-r--r--source4/libcli/ndr/ndr.c1
-rw-r--r--source4/libcli/ndr/ndr_basic.c4
2 files changed, 3 insertions, 2 deletions
diff --git a/source4/libcli/ndr/ndr.c b/source4/libcli/ndr/ndr.c
index d9a5ff7735..eca5799d8e 100644
--- a/source4/libcli/ndr/ndr.c
+++ b/source4/libcli/ndr/ndr.c
@@ -39,6 +39,7 @@ struct ndr_pull *ndr_pull_init_blob(DATA_BLOB *blob, TALLOC_CTX *mem_ctx)
ndr = talloc(mem_ctx, sizeof(*ndr));
if (!ndr) return NULL;
+ ndr->flags = 0;
ndr->data = blob->data;
ndr->data_size = blob->length;
ndr->offset = 0;
diff --git a/source4/libcli/ndr/ndr_basic.c b/source4/libcli/ndr/ndr_basic.c
index 21326c2a62..138e1f1a6c 100644
--- a/source4/libcli/ndr/ndr_basic.c
+++ b/source4/libcli/ndr/ndr_basic.c
@@ -120,8 +120,8 @@ NTSTATUS ndr_pull_guid(struct ndr_pull *ndr, GUID *guid)
#define NDR_PUSH_NEED_BYTES(ndr, n) NDR_CHECK(ndr_push_expand(ndr, ndr->offset+(n)))
#define NDR_PUSH_ALIGN(ndr, n) do { \
- ndr->offset = (ndr->offset + (n-1)) & ~(n-1); \
- NDR_CHECK(ndr_push_expand(ndr, ndr->offset)); \
+ uint32 _pad = (ndr->offset & (n-1)); \
+ while (_pad--) NDR_CHECK(ndr_push_u8(ndr, 0)); \
} while(0)
/*