Wireshark-commits: [Wireshark-commits] master-2.2 2e716c3: Make sure the offset doesn't overflow.

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

Commits:

2e716c3 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/27856
    

Actions performed:

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


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