Wireshark-commits: [Wireshark-commits] master 20c0fff: Wrap some tvb_get_ptr calls in crc32c_tvb_of
URL: https://code.wireshark.org/review/gitweb?p=wireshark.git;a=commit;h=20c0fffc922e09cbb0dbd4317080d3f9ed6a9cae
Submitter: Guy Harris (guy@xxxxxxxxxxxx)
Changed: branch: master
Repository: wireshark
Commits:
20c0fff by Guy Harris (guy@xxxxxxxxxxxx):
Wrap some tvb_get_ptr calls in crc32c_tvb_offset_calculate().
This eliminates some tvb_get_ptr calls from dissectors, as part of
trying to minimize if not eliminate its use in dissectors (it's a bit of
what's called an "attractive nuisance", in that users who don't
understand what it does - and doesn't! - do may use it in ways that are
unsafe, e.g. thinking you can use it to get a null-terminated string
from a packet).
It also eliminates the possibility of passing one length to
tvb_get_ptr() and another to crc32c_calculate().
Change-Id: I8a07168d0bc088b45d607e00c5bb1d98421ebc73
Reviewed-on: https://code.wireshark.org/review/3488
Reviewed-by: Guy Harris <guy@xxxxxxxxxxxx>
Actions performed:
from c10396d Fix read-past-end-of-buffer in CUPS dissector
adds 20c0fff Wrap some tvb_get_ptr calls in crc32c_tvb_offset_calculate().
Summary of changes:
epan/crc32-tvb.c | 11 +++++++++++
epan/crc32-tvb.h | 11 +++++++++++
epan/dissectors/packet-iscsi.c | 9 +++++----
epan/dissectors/packet-iwarp-mpa.c | 4 ++--
epan/dissectors/packet-zrtp.c | 3 ++-
5 files changed, 31 insertions(+), 7 deletions(-)