diff options
-rw-r--r-- | epan/tvbuff.h | 4 | ||||
-rw-r--r-- | epan/tvbuff_subset.c | 10 |
2 files changed, 7 insertions, 7 deletions
diff --git a/epan/tvbuff.h b/epan/tvbuff.h index 145ad3b28e..81e6a9bf78 100644 --- a/epan/tvbuff.h +++ b/epan/tvbuff.h @@ -180,10 +180,10 @@ WS_DLL_PUBLIC tvbuff_t *tvb_new_subset_length_caplen(tvbuff_t *backing, /** * Similar to tvb_new_subset_length_caplen() but with captured length calculated * to fit within the existing captured length and the specified - * backing length (which is used as the reported length). + * reported length. * Can throw ReportedBoundsError. */ WS_DLL_PUBLIC tvbuff_t *tvb_new_subset_length(tvbuff_t *backing, - const gint backing_offset, const gint backing_length); + const gint backing_offset, const gint reported_length); /** Similar to tvb_new_subset_length_caplen() but with backing_length and reported_length set * to -1. Can throw ReportedBoundsError. */ diff --git a/epan/tvbuff_subset.c b/epan/tvbuff_subset.c index cfcfbdec60..518d573bc5 100644 --- a/epan/tvbuff_subset.c +++ b/epan/tvbuff_subset.c @@ -155,7 +155,7 @@ tvb_new_subset_length_caplen(tvbuff_t *backing, const gint backing_offset, const } tvbuff_t * -tvb_new_subset_length(tvbuff_t *backing, const gint backing_offset, const gint backing_length) +tvb_new_subset_length(tvbuff_t *backing, const gint backing_offset, const gint reported_length) { gint captured_length; tvbuff_t *tvb; @@ -164,21 +164,21 @@ tvb_new_subset_length(tvbuff_t *backing, const gint backing_offset, const gint b DISSECTOR_ASSERT(backing && backing->initialized); - THROW_ON(backing_length < 0, ReportedBoundsError); + THROW_ON(reported_length < 0, ReportedBoundsError); /* * Give the next dissector only captured_length bytes. */ captured_length = tvb_captured_length_remaining(backing, backing_offset); THROW_ON(captured_length < 0, BoundsError); - if (captured_length > backing_length) - captured_length = backing_length; + if (captured_length > reported_length) + captured_length = reported_length; tvb_check_offset_length(backing, backing_offset, captured_length, &subset_tvb_offset, &subset_tvb_length); - tvb = tvb_new_with_subset(backing, backing_length, + tvb = tvb_new_with_subset(backing, reported_length, subset_tvb_offset, subset_tvb_length); tvb_add_to_chain(backing, tvb); |