Wireshark-commits: [Wireshark-commits] master 66417b1: Check first, then allocate.

From: Wireshark code review <code-review-do-not-reply@xxxxxxxxxxxxx>
Date: Fri, 15 Apr 2016 20:49:01 +0000 (UTC)
URL: https://code.wireshark.org/review/gitweb?p=wireshark.git;a=commit;h=66417b17b3570b163a16ca81f71ce5bcb10548d2
Submitter: Guy Harris (guy@xxxxxxxxxxxx)
Changed: branch: master
Repository: wireshark

Commits:

66417b1 by Guy Harris (guy@xxxxxxxxxxxx):

    Check first, then allocate.
    
    While we're at it, the MS-WSP spec says that the array size is unsigned,
    and sizeof is always unsigned, so do unsigned arithmetic when doing the
    multiplication, so we don't have to worry about overflowing the maximum
    int size.
    
    Bug: 12341
    Change-Id: Ic68d35bc75330571ef1daa244e8c94cb955955ca
    Reviewed-on: https://code.wireshark.org/review/14935
    Reviewed-by: Guy Harris <guy@xxxxxxxxxxxx>
    

Actions performed:

    from  3ee37d7   GSM: add a sanity check
    adds  66417b1   Check first, then allocate.


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