Wireshark-commits: [Wireshark-commits] master-2.2 3b77c0a: Do bounds checking of the offset and len
From: Wireshark code review <code-review-do-not-reply@xxxxxxxxxxxxx>
Date: Sun, 10 Jun 2018 01:13:41 +0000
URL: https://code.wireshark.org/review/gitweb?p=wireshark.git;a=commit;h=3b77c0a596a8071aebc1de71e3f79e5e15e919ca
Submitter: Guy Harris (guy@xxxxxxxxxxxx)
Changed: branch: master-2.2
Repository: wireshark

Commits:

3b77c0a by Guy Harris (guy@xxxxxxxxxxxx):

    Do bounds checking of the offset and length in proto_tree_add_string().
    
    Throw an exception if they don't correspond to data available in the
    packet - and do so even if the protocol tree argument is null, so that
    we catch very long strings that could cause the offset to overflow.
    
    Ask why we try to handle a null pointer passed as the string argument,
    while we're at it.
    
    Bug: 14738
    Change-Id: I2fa79ad0dcd1f41608844a573e045197ac60aa62
    Reviewed-on: https://code.wireshark.org/review/28179
    Reviewed-by: Guy Harris <guy@xxxxxxxxxxxx>
    (cherry picked from commit 0fbb5f84d00426040bd37dd89d74e2ecda5b598e)
    Reviewed-on: https://code.wireshark.org/review/28182
    

Actions performed:

    from  f575f08   Use FT_NONE, not FT_STRINGZ, for the field that covers the packet.
    adds  3b77c0a   Do bounds checking of the offset and length in proto_tree_add_string().


Summary of changes:
 epan/proto.c | 16 ++++++++++++++++
 1 file changed, 16 insertions(+)