summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJeremy Allison <jra@samba.org>2005-06-17 18:05:46 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 10:57:19 -0500
commit5c9963c287e20a4a4b8bbaa088328438eb4f942c (patch)
tree24424eb4f252aa3bce2192706499b57e810392c0
parenta5808e7ddbe3d333057c44db5e76bf8ef032489a (diff)
downloadsamba-5c9963c287e20a4a4b8bbaa088328438eb4f942c.tar.gz
samba-5c9963c287e20a4a4b8bbaa088328438eb4f942c.tar.bz2
samba-5c9963c287e20a4a4b8bbaa088328438eb4f942c.zip
r7696: Don't try and be clever and read an 8 byte int and 3 pad bytes
as a uint32 - you'll just get it wrong (as I did :-). Second attempt to fix the Apple client issues. Jeremy. (This used to be commit d2aa5bc7aaa9fe11fa4748f99e4ba49be08aa639)
-rw-r--r--source3/include/rpc_dce.h2
-rw-r--r--source3/rpc_parse/parse_rpc.c4
2 files changed, 3 insertions, 3 deletions
diff --git a/source3/include/rpc_dce.h b/source3/include/rpc_dce.h
index 68cc55bf31..abc85035ea 100644
--- a/source3/include/rpc_dce.h
+++ b/source3/include/rpc_dce.h
@@ -231,7 +231,7 @@ typedef struct rpc_context {
/* RPC_BIND_REQ - ms req bind */
typedef struct rpc_bind_req_info {
RPC_HDR_BBA bba;
- uint32 num_contexts; /* the number of contexts */
+ uint8 num_contexts; /* the number of contexts */
RPC_CONTEXT *rpc_context;
} RPC_HDR_RB;
diff --git a/source3/rpc_parse/parse_rpc.c b/source3/rpc_parse/parse_rpc.c
index ef5c230d2d..3c10975876 100644
--- a/source3/rpc_parse/parse_rpc.c
+++ b/source3/rpc_parse/parse_rpc.c
@@ -463,10 +463,10 @@ BOOL smb_io_rpc_hdr_rb(const char *desc, RPC_HDR_RB *rpc, prs_struct *ps, int de
if(!smb_io_rpc_hdr_bba("", &rpc->bba, ps, depth))
return False;
- if(!prs_uint32("num_contexts", ps, depth, &rpc->num_contexts))
+ if(!prs_uint8("num_contexts", ps, depth, &rpc->num_contexts))
return False;
- rpc->num_contexts &= 0xff; /* Actually a 1 byte field.. */
+ /* 3 pad bytes following - will be mopped up by the prs_align in smb_io_rpc_context(). */
/* num_contexts must not be zero. */
if (rpc->num_contexts == 0)