Wireshark-commits: [Wireshark-commits] master 64b6b68: TCPStreamDialog: prevent access to uninitial

From: Wireshark code review <code-review-do-not-reply@xxxxxxxxxxxxx>
Date: Sun, 26 Apr 2020 06:14:06 +0000
URL: https://code.wireshark.org/review/gitweb?p=wireshark.git;a=commit;h=64b6b68efa317802a8718b0b4ca227694594b1a3
Submitter: "Anders Broman <a.broman58@xxxxxxxxx>"
Changed: branch: master
Repository: wireshark

Commits:

64b6b68 by Martin Kaiser (wireshark@xxxxxxxxx):

    TCPStreamDialog: prevent access to uninitialized memory
    
    If we launch a TCPStreamDialog in a situation where we can't select a
    corresponding tcp stream, we leave the constructor before graph_
    is initialized.
    
    Later on, the destructor calls graph_segment_list_free(&graph_).
    This requires that graph_ was initialized before.
    
    Make sure that we initialize graph_ in the constructor, regardless
    of errors.
    
    (There's other aspects of this issue. We shouldn't be able to
    launch a TCPStreamDialog when we have no tcp stream...)
    
    Change-Id: I7b4ddadca8f699d30ec45f0fe6021ae9d36ced53
    Reviewed-on: https://code.wireshark.org/review/36935
    Reviewed-by: Martin Kaiser <wireshark@xxxxxxxxx>
    Petri-Dish: Martin Kaiser <wireshark@xxxxxxxxx>
    Tested-by: Petri Dish Buildbot
    Reviewed-by: Anders Broman <a.broman58@xxxxxxxxx>
    

Actions performed:

    from  d8137cc   ProfileTreeView: fix a memory leak
     add  64b6b68   TCPStreamDialog: prevent access to uninitialized memory


Summary of changes:
 ui/qt/tcp_stream_dialog.cpp | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)