Wireshark-commits: [Wireshark-commits] master 2da5915: Try to fix some PVS Studio warnings

From: Wireshark code review <code-review-do-not-reply@xxxxxxxxxxxxx>
Date: Thu, 17 Dec 2015 14:17:48 +0000 (UTC)
URL: https://code.wireshark.org/review/gitweb?p=wireshark.git;a=commit;h=2da59158a08316c3e755bb38eb155483b1b4b0a4
Submitter: Michal Labedzki (michal.labedzki@xxxxxxxxx)
Changed: branch: master
Repository: wireshark

Commits:

2da5915 by Michal Labedzki (michal.labedzki@xxxxxxxxx):

    Try to fix some PVS Studio warnings
    
    V814 Decreased performance. The 'strlen' function was called multiple times inside the body of a loop. androiddump.c 626
    V814 Decreased performance. The 'strlen' function was called multiple times inside the body of a loop. androiddump.c 661
    V814 Decreased performance. The 'strlen' function was called multiple times inside the body of a loop. androiddump.c 678
    V814 Decreased performance. The 'strlen' function was called multiple times inside the body of a loop. androiddump.c 689
    V814 Decreased performance. The 'strlen' function was called multiple times inside the body of a loop. androiddump.c 700
    V814 Decreased performance. The 'strlen' function was called multiple times inside the body of a loop. androiddump.c 711
    V814 Decreased performance. The 'strlen' function was called multiple times inside the body of a loop. androiddump.c 728
    V814 Decreased performance. The 'strlen' function was called multiple times inside the body of a loop. androiddump.c 739
    V814 Decreased performance. The 'strlen' function was called multiple times inside the body of a loop. androiddump.c 750
    V814 Decreased performance. The 'strlen' function was called multiple times inside the body of a loop. androiddump.c 761
    V814 Decreased performance. The 'strlen' function was called multiple times inside the body of a loop. androiddump.c 810
    V814 Decreased performance. The 'strlen' function was called multiple times inside the body of a loop. androiddump.c 867
    V814 Decreased performance. The 'strlen' function was called multiple times inside the body of a loop. androiddump.c 889
    V814 Decreased performance. The 'strlen' function was called multiple times inside the body of a loop. androiddump.c 949
    V814 Decreased performance. The 'strlen' function was called multiple times inside the body of a loop. androiddump.c 971
    V804 Decreased performance. The 'strlen' function is called twice in the specified expression to calculate length of the same string. androiddump.c 1876
    V512 A call of the 'memcpy' function will lead to underflow of the buffer 'packet + exported_pdu_headers_size'. androiddump.c 1950
    V804 Decreased performance. The 'strlen' function is called twice in the specified expression to calculate length of the same string. androiddump.c 2053
    V804 Decreased performance. The 'strlen' function is called twice in the specified expression to calculate length of the same string. androiddump.c 2056
    V512 A call of the 'memcpy' function will lead to underflow of the buffer 'packet + exported_pdu_headers_size'. androiddump.c 2122
    V590 Consider inspecting this expression. The expression is excessive or contains a misprint. androiddump.c 2207
    V590 Consider inspecting this expression. The expression is excessive or contains a misprint. androiddump.c 2227
    V530 The return value of function 'freopen' is required to be utilized. androiddump.c 2275
    V530 The return value of function 'freopen' is required to be utilized. androiddump.c 2279
    V808 'name' object of 'QString' type was created but was not utilized. bluetooth_devices_dialog.cpp 201
    V807 Decreased performance. Consider creating a pointer to avoid using the 'ui->tableTreeWidget->headerItem()' expression repeatedly. bluetooth_devices_dialog.cpp 337
    V807 Decreased performance. Consider creating a pointer to avoid using the 'item->child(i_item)' expression repeatedly. bluetooth_hci_summary_dialog.cpp 648
    V807 Decreased performance. Consider creating a pointer to avoid using the 'ui->tableTreeWidget->headerItem()' expression repeatedly. bluetooth_hci_summary_dialog.cpp 669
    
    Change-Id: Ia81b5f867b2b1e0ee58eed0bd297800774bc37f9
    Reviewed-on: https://code.wireshark.org/review/12683
    Petri-Dish: Michal Labedzki <michal.labedzki@xxxxxxxxx>
    Tested-by: Petri Dish Buildbot <buildbot-no-reply@xxxxxxxxxxxxx>
    Reviewed-by: Michal Labedzki <michal.labedzki@xxxxxxxxx>
    

Actions performed:

    from  682cf6d   androiddump: Remove all mallocs
    adds  2da5915   Try to fix some PVS Studio warnings


Summary of changes:
 extcap/androiddump.c                   |  113 ++++++++++++++++++++------------
 ui/qt/bluetooth_devices_dialog.cpp     |   30 +++++----
 ui/qt/bluetooth_hci_summary_dialog.cpp |   49 ++++++++------
 3 files changed, 114 insertions(+), 78 deletions(-)