diff options
author | João Valverde <j@v6e.pt> | 2022-05-22 21:02:22 +0100 |
---|---|---|
committer | João Valverde <j@v6e.pt> | 2022-05-23 23:04:07 +0100 |
commit | 51de43cfd2467f3e9f63fe0970ac9fb4553b3dd7 (patch) | |
tree | d9709c6bc5513b3e2805e22b1dbd7da3053fbe4e /epan/dtd.h | |
parent | ce52af1a3286bd1f8069fba7240f3e98b50ab7e0 (diff) |
dfilter: Fix protocol slices with negative indexes
Field infos have a length property that was not stored with the
field value so when using a negative index the end was computed
from the captured length of the frame tvbuff, leading to incorrect
results. The documentation in wireshark-filter(5) describes how
this was supposed to work but as far as I can tell it never worked
properly.
We now store the length and use that (when it is different from -1)
to locate the end of the protocol data in the tvbuff. An extra wrinkle
is that sometimes the length is set after the field value is created.
This is the most common case as the majority of protocols have a
variable length and dissection generally proceeds with a TVB subset from
the current layer (with offset zero) through all remaining layers to the
end of the captured length. For that reason we must use an expedient to allow
changing the protocol length of an existing protocol fvalue, whenever
proto_item_set_len() is called.
Fixes #17772.
Diffstat (limited to 'epan/dtd.h')
0 files changed, 0 insertions, 0 deletions