Fix display of composite tvbs in GUI

a composite tvb is the top-level data source tvb
fix composite_get_ptr function

Change-Id: Ibab58801a754fd88fb86b9a13804bccf2ad51c7a
Reviewed-on: https://code.wireshark.org/review/15643
Reviewed-by: Pascal Quantin <pascal.quantin@gmail.com>
Petri-Dish: Pascal Quantin <pascal.quantin@gmail.com>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Michael Mann <mmann78@netscape.net>
This commit is contained in:
Pascal Quantin 2016-05-31 16:11:41 +02:00 committed by Michael Mann
parent 0ea05962e2
commit 35feab8a4a
1 changed files with 5 additions and 2 deletions

View File

@ -112,8 +112,10 @@ composite_get_ptr(tvbuff_t *tvb, guint abs_offset, guint abs_length)
return tvb_get_ptr(member_tvb, member_offset, abs_length);
}
else {
tvb->real_data = (guint8 *)g_malloc(abs_length);
tvb_memcpy(tvb, (void *)tvb->real_data, 0, abs_length);
/* Use a temporary variable as tvb_memcpy is also checking tvb->real_data pointer */
void *real_data = g_malloc(abs_length);
tvb_memcpy(tvb, real_data, 0, abs_length);
tvb->real_data = (const guint8 *)real_data;
return tvb->real_data + abs_offset;
}
@ -296,6 +298,7 @@ tvb_composite_finalize(tvbuff_t *tvb)
tvb_add_to_chain((tvbuff_t *)composite->tvbs->data, tvb); /* chain composite tvb to first member */
tvb->initialized = TRUE;
tvb->ds_tvb = tvb;
}
/*