packet-dcerpc-*: fix alignment of dissect_ndr_ctx_hnd()
authorStefan Metzmacher <metze@samba.org>
Tue, 17 Mar 2015 07:43:15 +0000 (08:43 +0100)
committerAnders Broman <a.broman58@gmail.com>
Tue, 17 Mar 2015 09:03:27 +0000 (09:03 +0000)
Change-Id: I9685f37580d1def6c0956d786398e3e70e819cee
Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-on: https://code.wireshark.org/review/7714
Reviewed-by: Anders Broman <a.broman58@gmail.com>
epan/dissectors/packet-dcerpc-ndr.c
epan/dissectors/packet-dcerpc-nt.c

index bbc37e1ac4f7108c465640c9534a2054e5d43d1a..d3f7c9bc3d48f8faeb97ac496556023a55a888c2 100644 (file)
@@ -560,7 +560,7 @@ dissect_ndr_ctx_hnd(tvbuff_t *tvb, gint offset, packet_info *pinfo _U_,
         return offset;
     }
 
-    if (!di->no_align && (offset % 2)) {
+    if (!di->no_align && (offset % 4)) {
         offset += 4 - (offset % 4);
     }
     ctx_hnd.attributes = dcerpc_tvb_get_ntohl(tvb, offset, drep);
index d8a95fa97df16c9bd4b9b0326b5e9b11bee6a67f..2150121f89b86a5100f8bbaa160592f79c22f46d 100644 (file)
@@ -971,6 +971,9 @@ dissect_nt_hnd(tvbuff_t *tvb, gint offset, packet_info *pinfo,
 
        switch(type){
        case HND_TYPE_CTX_HANDLE:
+               if (!di->no_align && (offset % 4)) {
+                       offset += 4 - (offset % 4);
+               }
                subtree = proto_tree_add_subtree(tree, tvb, offset, sizeof(e_ctx_hnd),
                                           ett_nt_policy_hnd, &item, "Policy Handle");