Wireshark-commits: [Wireshark-commits] lts-1.12.1 ed57db5: Don't treat the packet length as unsigne
From: Wireshark code review <code-review-do-not-reply@xxxxxxxxxxxxx>
Date: Fri, 24 Jun 2016 00:02:22 +0000 (UTC)
URL: https://code.wireshark.org/review/gitweb?p=wireshark.git;a=commit;h=ed57db580b07a2a2c9589dc08041660cc74da87a
Submitter: Balint Reczey (balint@xxxxxxxxxxxxxxx)
Changed: branch: lts-1.12.1
Repository: wireshark

Commits:

ed57db5 by Guy Harris (guy@xxxxxxxxxxxx):

    Don't treat the packet length as unsigned.
    
    The scanf family of functions are as annoyingly bad at handling unsigned
    numbers as strtoul() is - both of them are perfectly willing to accept a
    value beginning with a negative sign as an unsigned value.  When using
    strtoul(), you can compensate for this by explicitly checking for a '-'
    as the first character of the string, but you can't do that with
    sscanf().
    
    So revert to having pkt_len be signed, and scanning it with %d, but
    check for a negative value and fail if we see a negative value.
    
    Bug: 12395
    Change-Id: I43b458a73b0934e9a5c2c89d34eac5a8f21a7455
    Reviewed-on: https://code.wireshark.org/review/15223
    Reviewed-by: Guy Harris <guy@xxxxxxxxxxxx>
    (cherry picked from commit a66628e425db725df1ac52a3c573a03357060ddd)
    Reviewed-on: https://code.wireshark.org/review/15225
    (cherry picked from commit 1635420a4a024ac500f650bee338e389279d0704)
    Reviewed-on: https://code.wireshark.org/review/16114
    Reviewed-by: Balint Reczey <balint@xxxxxxxxxxxxxxx>
    

Actions performed:

    from  fb514c2   Fix packet length handling.
    adds  ed57db5   Don't treat the packet length as unsigned.


Summary of changes:
 wiretap/cosine.c |   12 ++++++++----
 1 file changed, 8 insertions(+), 4 deletions(-)