diff options
Diffstat (limited to 'epan/tvbuff.c')
-rw-r--r-- | epan/tvbuff.c | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/epan/tvbuff.c b/epan/tvbuff.c index f087480509..33e86a3289 100644 --- a/epan/tvbuff.c +++ b/epan/tvbuff.c @@ -795,9 +795,17 @@ tvb_memcpy(tvbuff_t *tvb, void *target, const gint offset, size_t length) if (tvb->ops->tvb_memcpy) return tvb->ops->tvb_memcpy(tvb, target, abs_offset, abs_length); - /* XXX, fallback to slower method */ - - DISSECTOR_ASSERT_NOT_REACHED(); + /* + * If the length is 0, there's nothing to do. + * (tvb->real_data could be null if it's allocated with + * a size of length.) + */ + if (length != 0) { + /* + * XXX, fallback to slower method + */ + DISSECTOR_ASSERT_NOT_REACHED(); + } return NULL; } |