Wireshark-commits: [Wireshark-commits] master-2.4 c1afa79: Make sure the offset doesn't overflow.

From: Wireshark code review <code-review-do-not-reply@xxxxxxxxxxxxx>
Date: Mon, 28 May 2018 02:45:43 +0000
URL: https://code.wireshark.org/review/gitweb?p=wireshark.git;a=commit;h=c1afa79ccc17c6e8a81319be03bffed4c0d7210a
Submitter: Guy Harris (guy@xxxxxxxxxxxx)
Changed: branch: master-2.4
Repository: wireshark

Commits:

c1afa79 by Guy Harris (guy@xxxxxxxxxxxx):

    Make sure the offset doesn't overflow.
    
    It'd only overflow if the value is *so* large that it won't fit in the
    packet (given that we have a 2^32-1-byte limit on the packet size), so
    use tvb_ensure_bytes_exist() to ensure we have the entire value before
    processing the value.
    
    (The real problem is that we don't handle the case where there's a value
    multiplicity > 1 for some types; in those cases, we should loop,
    processing all the values, which would cause us to eventually throw an
    exception when we ran past the end of the packet.  This is just a quick
    fix.)
    
    Bug: 14742
    Change-Id: I447ece81d1c84d3b1d218faeb2c155f910208c29
    Reviewed-on: https://code.wireshark.org/review/27853
    Reviewed-by: Guy Harris <guy@xxxxxxxxxxxx>
    (cherry picked from commit 25118898a931589cfdea4693e056a02b7daecf10)
    Reviewed-on: https://code.wireshark.org/review/27855
    

Actions performed:

    from  f750e2f   Fix incorrect formatting of NSAP area addresses/address prefixes.
    adds  c1afa79   Make sure the offset doesn't overflow.


Summary of changes:
 epan/dissectors/packet-dcm.c | 5 +++++
 1 file changed, 5 insertions(+)