forked from osmocom/wireshark
Rename the last argument to tvb_new_subset_length().
In tvb_new_subset_length_caplen(), the captured length argument is backing_length and the reported length argument is reported_length. The length argument to tvb_new_subset_length() is a reported length, not a captured length, so call it reported_length, not backing_length. Change-Id: Ibfb30e15bdd885d3c0fd66e2b4b07c4a45327f14 Reviewed-on: https://code.wireshark.org/review/26863 Reviewed-by: Guy Harris <guy@alum.mit.edu>
This commit is contained in:
parent
b67a10c9ea
commit
b3c51deb24
|
@ -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. */
|
||||
|
|
|
@ -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);
|
||||
|
|
Loading…
Reference in New Issue