Wireshark-commits: [Wireshark-commits] master-2.0 e499daa: Don't treat the packet length as unsigne

From: Wireshark code review <code-review-do-not-reply@xxxxxxxxxxxxx>
Date: Sun, 1 May 2016 23:04:47 +0000 (UTC)
URL: https://code.wireshark.org/review/gitweb?p=wireshark.git;a=commit;h=e499daadd34ae8c8598b99b8718a41ea47a3fa1e
Submitter: Guy Harris (guy@xxxxxxxxxxxx)
Changed: branch: master-2.0
Repository: wireshark

Commits:

e499daa 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.
    
    Change-Id: I6450d468504e942df72342176a0e145e5ac3db5f
    Reviewed-on: https://code.wireshark.org/review/15216
    Reviewed-by: Guy Harris <guy@xxxxxxxxxxxx>
    (cherry picked from commit 29c78db2a80a93653f32e4fd2f00b9b550432c43)
    Reviewed-on: https://code.wireshark.org/review/15217
    

Actions performed:

    from  20e7875   Make class "type" for USB conversations.
    adds  e499daa   Don't treat the packet length as unsigned.


Summary of changes:
 wiretap/dbs-etherwatch.c |   13 +++++++++----
 1 file changed, 9 insertions(+), 4 deletions(-)