From 5c9963c287e20a4a4b8bbaa088328438eb4f942c Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Fri, 17 Jun 2005 18:05:46 +0000 Subject: 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) --- source3/include/rpc_dce.h | 2 +- source3/rpc_parse/parse_rpc.c | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) (limited to 'source3') 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) -- cgit