From: sahlberg Date: Wed, 6 Mar 2002 08:28:57 +0000 (+0000) Subject: Fixed bug in dissect_ndr_pointer(). Top level Unique and Full pointers are X-Git-Url: http://git.samba.org/samba.git/?p=obnox%2Fwireshark%2Fwip.git;a=commitdiff_plain;h=c695bcdfafb10c7646c323f3fc00a52365f3c7ee Fixed bug in dissect_ndr_pointer(). Top level Unique and Full pointers are not encoded in the same way in the NDR representation. git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@4887 f5534014-38df-0310-8fa8-9805f1628bb7 --- diff --git a/packet-dcerpc.c b/packet-dcerpc.c index 6a41c69b62..90c9df8b67 100644 --- a/packet-dcerpc.c +++ b/packet-dcerpc.c @@ -2,7 +2,7 @@ * Routines for DCERPC packet disassembly * Copyright 2001, Todd Sabin * - * $Id: packet-dcerpc.c,v 1.35 2002/02/13 04:12:42 guy Exp $ + * $Id: packet-dcerpc.c,v 1.36 2002/03/06 08:28:57 sahlberg Exp $ * * Ethereal - Network traffic analyzer * By Gerald Combs @@ -706,9 +706,8 @@ dissect_ndr_pointer(tvbuff_t *tvb, gint offset, packet_info *pinfo, } /*TOP LEVEL FULL POINTER*/ - /*TOP LEVEL UNIQUE POINTER*/ if( pointers_are_top_level - && ((type==NDR_POINTER_PTR)||(type==NDR_POINTER_UNIQUE)) ){ + && (type==NDR_POINTER_PTR) ){ int idx; guint32 id; proto_item *item; @@ -730,7 +729,7 @@ dissect_ndr_pointer(tvbuff_t *tvb, gint offset, packet_info *pinfo, /* we have seen this pointer before */ if(idx>=0){ proto_tree_add_text(tree, tvb, offset-4, 4, - "(duplicate) %s",text); + "(duplicate PTR) %s",text); goto after_ref_id; } @@ -742,6 +741,32 @@ dissect_ndr_pointer(tvbuff_t *tvb, gint offset, packet_info *pinfo, add_pointer_to_list(pinfo, tr, fnct, id, hf_index, levels); goto after_ref_id; } + /*TOP LEVEL UNIQUE POINTER*/ + if( pointers_are_top_level + && (type==NDR_POINTER_UNIQUE) ){ + int idx; + guint32 id; + proto_item *item; + proto_tree *tr; + + /* get the referent id */ + offset = dissect_ndr_uint32(tvb, offset, pinfo, NULL, drep, -1, &id); + + /* we got a NULL pointer */ + if(id==0){ + proto_tree_add_text(tree, tvb, offset-4, 4, + "(NULL pointer)%s",text); + goto after_ref_id; + } + + /* new pointer */ + item=proto_tree_add_text(tree, tvb, offset-4, 4, + "%s", text); + tr=proto_item_add_subtree(item,ett_dcerpc_pointer_data); + proto_tree_add_uint(tr, hf_dcerpc_referent_id, tvb, offset-4, 4, id); + add_pointer_to_list(pinfo, tr, fnct, 0xffffffff, hf_index, levels); + goto after_ref_id; + } /*EMBEDDED REFERENCE POINTER*/ if( (!pointers_are_top_level) @@ -812,7 +837,8 @@ dissect_ndr_pointer(tvbuff_t *tvb, gint offset, packet_info *pinfo, /* we have seen this pointer before */ if(idx>=0){ - proto_tree_add_uint(tree, hf_dcerpc_referent_id, tvb, offset-4, 4, id); + proto_tree_add_text(tree, tvb, offset-4, 4, + "(duplicate PTR) %s",text); goto after_ref_id; }