diff options
author | Andrew Tridgell <tridge@samba.org> | 2003-11-04 22:42:00 +0000 |
---|---|---|
committer | Andrew Tridgell <tridge@samba.org> | 2003-11-04 22:42:00 +0000 |
commit | c1b3ebb1fa51a8b91e94d48ec272846235de1c03 (patch) | |
tree | 36b7c18702c7069587cfdde60325bed1e499a918 /source4/libcli | |
parent | 41304b3c5791be0a5492844a048784c4ef4acfe9 (diff) | |
download | samba-c1b3ebb1fa51a8b91e94d48ec272846235de1c03.tar.gz samba-c1b3ebb1fa51a8b91e94d48ec272846235de1c03.tar.bz2 samba-c1b3ebb1fa51a8b91e94d48ec272846235de1c03.zip |
fixed some error found by valgrind
(This used to be commit ca5f0ccb6cd10d51c96a5cd8e0cd97d50cbb9a73)
Diffstat (limited to 'source4/libcli')
-rw-r--r-- | source4/libcli/ndr/ndr.c | 1 | ||||
-rw-r--r-- | source4/libcli/ndr/ndr_basic.c | 4 | ||||
-rw-r--r-- | source4/libcli/raw/rawdcerpc.c | 3 | ||||
-rw-r--r-- | source4/libcli/rpc/dcerpc.c | 6 |
4 files changed, 11 insertions, 3 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) /* diff --git a/source4/libcli/raw/rawdcerpc.c b/source4/libcli/raw/rawdcerpc.c index a253e0eb65..0541200015 100644 --- a/source4/libcli/raw/rawdcerpc.c +++ b/source4/libcli/raw/rawdcerpc.c @@ -105,7 +105,10 @@ struct cli_request *dcerpc_raw_send(struct dcerpc_pipe *p, DATA_BLOB *blob) trans.in.max_param = 0; trans.in.max_data = 0x8000; + trans.in.max_setup = 0; trans.in.setup_count = 2; + trans.in.flags = 0; + trans.in.timeout = 0; trans.in.setup = setup; trans.in.trans_name = "\\PIPE\\"; diff --git a/source4/libcli/rpc/dcerpc.c b/source4/libcli/rpc/dcerpc.c index 89f2c6d5b1..9e6c05e7ae 100644 --- a/source4/libcli/rpc/dcerpc.c +++ b/source4/libcli/rpc/dcerpc.c @@ -38,6 +38,7 @@ struct dcerpc_pipe *dcerpc_pipe_init(struct cli_tree *tree) return NULL; } + p->reference_count = 0; p->mem_ctx = mem_ctx; p->tree = tree; p->tree->reference_count++; @@ -746,7 +747,10 @@ NTSTATUS dcerpc_request(struct dcerpc_pipe *p, /* - a useful helper function for synchronous rpc requests + a useful helper function for synchronous rpc requests + + this can be used when you have ndr push/pull functions in the + standard format */ NTSTATUS dcerpc_ndr_request(struct dcerpc_pipe *p, uint32 opnum, |