forked from osmocom/wireshark
SOME/IP: Fixed incorrect resetting offset of static array.
Fixed resetting offset of array to enable only when created tvb subset. Fixes #17057
(cherry picked from commit 2ab153527d
)
This commit is contained in:
parent
b668d0a9d5
commit
9cee503a87
|
@ -2271,6 +2271,8 @@ dissect_someip_payload_array_payload(tvbuff_t* tvb, packet_info* pinfo, proto_tr
|
||||||
if (length != -1) {
|
if (length != -1) {
|
||||||
if (length <= tvb_captured_length_remaining(tvb, offset)) {
|
if (length <= tvb_captured_length_remaining(tvb, offset)) {
|
||||||
subtvb = tvb_new_subset_length_caplen(tvb, offset, length, length);
|
subtvb = tvb_new_subset_length_caplen(tvb, offset, length, length);
|
||||||
|
/* created subtvb. so we set offset=0 */
|
||||||
|
offset = 0;
|
||||||
} else {
|
} else {
|
||||||
expert_someip_payload_truncated(tree, pinfo, tvb, offset, tvb_captured_length_remaining(tvb, offset));
|
expert_someip_payload_truncated(tree, pinfo, tvb, offset, tvb_captured_length_remaining(tvb, offset));
|
||||||
return tvb_captured_length_remaining(tvb, offset);
|
return tvb_captured_length_remaining(tvb, offset);
|
||||||
|
@ -2279,8 +2281,6 @@ dissect_someip_payload_array_payload(tvbuff_t* tvb, packet_info* pinfo, proto_tr
|
||||||
subtvb = tvb;
|
subtvb = tvb;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* created subtvb. so we set offset=0 */
|
|
||||||
offset = 0;
|
|
||||||
while ((length == -1 && count < upper_limit) || ((gint)(8 * offset + offset_bits) < 8 * length)) {
|
while ((length == -1 && count < upper_limit) || ((gint)(8 * offset + offset_bits) < 8 * length)) {
|
||||||
bits_parsed = dissect_someip_payload_parameter(subtvb, pinfo, tree, offset, offset_bits, (guint8)config->data_type, config->id_ref, config->name);
|
bits_parsed = dissect_someip_payload_parameter(subtvb, pinfo, tree, offset, offset_bits, (guint8)config->data_type, config->id_ref, config->name);
|
||||||
if (bits_parsed == 0) {
|
if (bits_parsed == 0) {
|
||||||
|
@ -2297,7 +2297,12 @@ dissect_someip_payload_array_payload(tvbuff_t* tvb, packet_info* pinfo, proto_tr
|
||||||
col_append_str(pinfo->cinfo, COL_INFO, " [SOME/IP Payload: Dynamic array does not stay between Min and Max values]");
|
col_append_str(pinfo->cinfo, COL_INFO, " [SOME/IP Payload: Dynamic array does not stay between Min and Max values]");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (length != -1) {
|
||||||
ret = 8 * offset + offset_bits;
|
ret = 8 * offset + offset_bits;
|
||||||
|
} else {
|
||||||
|
ret = 8 * (offset - offset_orig) + offset_bits;
|
||||||
|
}
|
||||||
|
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue