Wireshark-commits: [Wireshark-commits] master 3951759: Qt: avoid NULL to terminate a g_build_filena

From: Wireshark code review <code-review-do-not-reply@xxxxxxxxxxxxx>
Date: Mon, 29 Jul 2019 19:55:45 +0000
URL: https://code.wireshark.org/review/gitweb?p=wireshark.git;a=commit;h=3951759e83b30e245aa0e485688e5b7f1a0ee8e4
Submitter: "Peter Wu <peter@xxxxxxxxxxxxx>"
Changed: branch: master
Repository: wireshark

Commits:

3951759 by Peter Wu (peter@xxxxxxxxxxxxx):

    Qt: avoid NULL to terminate a g_build_filename in ExportObjectModel
    
    While documentation for g_build_filename suggests the use of NULL as
    terminator, the C++ standard permits NULL to be defined as integer 0.
    This potentially has a different size than a void pointer and can cause
    crashes if this is the case. Instead of using (void*)0 as terminator,
    let's just rewrite this piece to avoid the problem in its entirely.
    
    Fixes "missing sentinel" warning in GCC with musl due to NULL being 0L.
    
    Change-Id: I6a7911887eaeeaa56fdb03d14ee8b70a42c8a05b
    Reviewed-on: https://code.wireshark.org/review/34107
    Petri-Dish: Peter Wu <peter@xxxxxxxxxxxxx>
    Tested-by: Petri Dish Buildbot
    Reviewed-by: Dario Lombardo <lomato@xxxxxxxxx>
    Reviewed-by: Peter Wu <peter@xxxxxxxxxxxxx>
    

Actions performed:

    from  04c12dd   doc: document WIRESHARK_CONFIG_DIR
     add  3951759   Qt: avoid NULL to terminate a g_build_filename in ExportObjectModel


Summary of changes:
 ui/qt/models/export_objects_model.cpp | 15 +++++++--------
 1 file changed, 7 insertions(+), 8 deletions(-)