diff options
author | Stefan Metzmacher <metze@samba.org> | 2014-01-30 09:51:09 +0100 |
---|---|---|
committer | Günther Deschner <gd@samba.org> | 2014-02-11 16:20:28 +0100 |
commit | f9cc66055ddf09699b5bee229e10fdbf9ca5ce93 (patch) | |
tree | 18b605edcd614927095ab665eab4de30c6474610 /source3/librpc/rpc | |
parent | 754f2eba16822c998c9381d61da7bdfa9bac19ee (diff) | |
download | samba-f9cc66055ddf09699b5bee229e10fdbf9ca5ce93.tar.gz samba-f9cc66055ddf09699b5bee229e10fdbf9ca5ce93.tar.xz samba-f9cc66055ddf09699b5bee229e10fdbf9ca5ce93.zip |
s3:dcerpc_ep: make ep_register() more tolerant regarding the passes binding vector
We should take a copy and set the abstract syntax to from the given interface
before we construct the tower.
Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Guenther Deschner <gd@samba.org>
Diffstat (limited to 'source3/librpc/rpc')
-rw-r--r-- | source3/librpc/rpc/dcerpc_ep.c | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/source3/librpc/rpc/dcerpc_ep.c b/source3/librpc/rpc/dcerpc_ep.c index d0c264a5a84..99a88c42512 100644 --- a/source3/librpc/rpc/dcerpc_ep.c +++ b/source3/librpc/rpc/dcerpc_ep.c @@ -398,9 +398,17 @@ static NTSTATUS ep_register(TALLOC_CTX *mem_ctx, entries = talloc_array(tmp_ctx, struct epm_entry_t, num_ents); for (i = 0; i < num_ents; i++) { - struct dcerpc_binding *map_binding = bind_vec->bindings[i]; + struct dcerpc_binding *map_binding; struct epm_twr_t *map_tower; + map_binding = dcerpc_binding_dup(entries, bind_vec->bindings[i]); + if (map_binding == NULL) { + status = NT_STATUS_NO_MEMORY; + goto done; + } + + map_binding->object = iface->syntax_id; + map_tower = talloc_zero(entries, struct epm_twr_t); if (map_tower == NULL) { status = NT_STATUS_NO_MEMORY; @@ -414,6 +422,8 @@ static NTSTATUS ep_register(TALLOC_CTX *mem_ctx, goto done; } + TALLOC_FREE(map_binding); + entries[i].tower = map_tower; if (annotation == NULL) { entries[i].annotation = talloc_strdup(entries, ""); |