summaryrefslogtreecommitdiffstats
path: root/librpc
diff options
context:
space:
mode:
authorAndreas Schneider <asn@samba.org>2011-03-24 13:45:32 +0100
committerSimo Sorce <idra@samba.org>2011-03-24 14:57:13 -0400
commitedc26007bf50ce165b8f8dfba5e1c7f86f6918e6 (patch)
tree1cfd93a3b14898f7a846419203d657d81201ba7a /librpc
parent95daebe1c339cefe87bcb5d4e2afc79a45af3b62 (diff)
downloadsamba-edc26007bf50ce165b8f8dfba5e1c7f86f6918e6.tar.gz
samba-edc26007bf50ce165b8f8dfba5e1c7f86f6918e6.tar.xz
samba-edc26007bf50ce165b8f8dfba5e1c7f86f6918e6.zip
librpc: Return an error if we a broken floor.
Pair-Programmed-With: Simo Sorce <idra@samba.org>
Diffstat (limited to 'librpc')
-rw-r--r--librpc/rpc/binding.c13
1 files changed, 9 insertions, 4 deletions
diff --git a/librpc/rpc/binding.c b/librpc/rpc/binding.c
index 59d508adca..422537e1f4 100644
--- a/librpc/rpc/binding.c
+++ b/librpc/rpc/binding.c
@@ -653,6 +653,15 @@ _PUBLIC_ NTSTATUS dcerpc_binding_from_tower(TALLOC_CTX *mem_ctx,
NTSTATUS status;
struct dcerpc_binding *binding;
+ /*
+ * A tower needs to have at least 4 floors to carry useful
+ * information. Floor 3 is the transport identifier which defines
+ * how many floors are required at least.
+ */
+ if (tower->num_floors < 4) {
+ return NT_STATUS_INVALID_PARAMETER;
+ }
+
binding = talloc_zero(mem_ctx, struct dcerpc_binding);
NT_STATUS_HAVE_NO_MEMORY(binding);
@@ -669,10 +678,6 @@ _PUBLIC_ NTSTATUS dcerpc_binding_from_tower(TALLOC_CTX *mem_ctx,
return NT_STATUS_NOT_SUPPORTED;
}
- if (tower->num_floors < 1) {
- return NT_STATUS_OK;
- }
-
/* Set object uuid */
status = dcerpc_floor_get_lhs_data(&tower->floors[0], &binding->object);