summaryrefslogtreecommitdiff
path: root/epan/proto.c
diff options
context:
space:
mode:
authorKovarththanan Rajaratnam <kovarththanan.rajaratnam@gmail.com>2009-08-21 17:11:02 +0000
committerKovarththanan Rajaratnam <kovarththanan.rajaratnam@gmail.com>2009-08-21 17:11:02 +0000
commit8a3f4f53eb626972453c072a600f8106ec82345d (patch)
tree78f1e6122775dc566ecbac76b46fefd1a5249478 /epan/proto.c
parent044aabb9ea061f2e8d1f6038386a6aade8ff487b (diff)
downloadwireshark-8a3f4f53eb626972453c072a600f8106ec82345d.tar.gz
Delay TRY_TO_FAKE_THIS_ITEM() in proto_tree_add_bits_ret_val() until we know it is safe.
Thanks to Martin for pointing this out in r29493. svn path=/trunk/; revision=29494
Diffstat (limited to 'epan/proto.c')
-rw-r--r--epan/proto.c10
1 files changed, 9 insertions, 1 deletions
diff --git a/epan/proto.c b/epan/proto.c
index 7665f78a30..c2ac555d9d 100644
--- a/epan/proto.c
+++ b/epan/proto.c
@@ -1374,6 +1374,9 @@ ptvcursor_add(ptvcursor_t *ptvc, int hfindex, gint length,
guint32 n;
int offset;
+ /* We can't fake it just yet. We have to advance the cursor
+ TRY_TO_FAKE_THIS_ITEM(ptvc->tree, hfindex, hfinfo); */
+
offset = ptvc->offset;
hfinfo = get_hfi_and_length(hfindex, ptvc->tvb, offset, &length,
&item_length);
@@ -1387,6 +1390,7 @@ ptvcursor_add(ptvcursor_t *ptvc, int hfindex, gint length,
ptvc->offset += n;
}
+ /* Coast clear. Try and fake it */
TRY_TO_FAKE_THIS_ITEM(ptvc->tree, hfindex, hfinfo);
new_fi = new_field_info(ptvc->tree, hfinfo, ptvc->tvb, offset,
@@ -6127,7 +6131,8 @@ proto_tree_add_bits_ret_val(proto_tree *tree, int hf_index, tvbuff_t *tvb, gint
int bit;
int i;
- PROTO_REGISTRAR_GET_NTH(hf_index, hf_field);
+ /* We can't fake it just yet. We have to fill in the 'return_value' parameter */
+ PROTO_REGISTRAR_GET_NTH(hf_index, hf_field);
if(hf_field -> bitmask != 0) {
REPORT_DISSECTOR_BUG(ep_strdup_printf("Incompatible use of proto_tree_add_bits_ret_val with field '%s' (%s) with bitmask != 0",
@@ -6166,6 +6171,9 @@ proto_tree_add_bits_ret_val(proto_tree *tree, int hf_index, tvbuff_t *tvb, gint
*return_value=value;
}
+ /* Coast clear. Try and fake it */
+ TRY_TO_FAKE_THIS_ITEM(tree, hf_index, hf_field);
+
mask = 1;
mask = mask << (no_of_bits-1);