diff options
author | Gerald Combs <gerald@zing.org> | 2014-03-01 11:13:08 -0800 |
---|---|---|
committer | Gerald Combs <gerald@wireshark.org> | 2014-03-01 19:15:38 +0000 |
commit | 79ef36a5f0c8b856080196b0af6d82db595c36d5 (patch) | |
tree | 44282fdf23db19229497fef339a14f2860c5f7ca /ui | |
parent | 0cb4b4e44ded39edde2d26f9669f416effeb856a (diff) |
Fix some scan-build warnings.
Fix a modeline while we're at it.
Change-Id: Ief6d5edbe33456170059cfab4f436f0844de32a1
Reviewed-on: https://code.wireshark.org/review/440
Reviewed-by: Gerald Combs <gerald@wireshark.org>
Diffstat (limited to 'ui')
-rw-r--r-- | ui/qt/main_window_slots.cpp | 2 | ||||
-rw-r--r-- | ui/qt/packet_list.cpp | 2 | ||||
-rw-r--r-- | ui/qt/tcp_stream_dialog.cpp | 1 | ||||
-rw-r--r-- | ui/tap-sctp-analysis.c | 4 |
4 files changed, 5 insertions, 4 deletions
diff --git a/ui/qt/main_window_slots.cpp b/ui/qt/main_window_slots.cpp index 0fc02c7e4e..a39cf939bd 100644 --- a/ui/qt/main_window_slots.cpp +++ b/ui/qt/main_window_slots.cpp @@ -102,7 +102,7 @@ void MainWindow::openCaptureFile(QString &cf_path, QString &display_filter) QString file_name = ""; dfilter_t *rfcode = NULL; int err; - unsigned int type; + unsigned int type = WTAP_TYPE_AUTO; testCaptureFileClose(false); diff --git a/ui/qt/packet_list.cpp b/ui/qt/packet_list.cpp index 4bfede1b27..89f9747929 100644 --- a/ui/qt/packet_list.cpp +++ b/ui/qt/packet_list.cpp @@ -505,7 +505,7 @@ void PacketList::contextMenuEvent(QContextMenuEvent *event) } - if (act->text().contains("SSL")) + if ((cap_file_ != NULL) && act->text().contains("SSL")) { if (epan_dissect_packet_contains_field(cap_file_->edt, "ssl")) { diff --git a/ui/qt/tcp_stream_dialog.cpp b/ui/qt/tcp_stream_dialog.cpp index a83e5e18df..747d5b268b 100644 --- a/ui/qt/tcp_stream_dialog.cpp +++ b/ui/qt/tcp_stream_dialog.cpp @@ -101,6 +101,7 @@ TCPStreamDialog::TCPStreamDialog(QWidget *parent, capture_file *cf, tcp_graph_ty struct tcpheader *header = select_tcpip_session(cap_file_, ¤t); if (!header) { done(QDialog::Rejected); + return; } //#ifdef Q_OS_MAC diff --git a/ui/tap-sctp-analysis.c b/ui/tap-sctp-analysis.c index a413fbbaac..d4ee71a15e 100644 --- a/ui/tap-sctp-analysis.c +++ b/ui/tap-sctp-analysis.c @@ -952,7 +952,7 @@ packet(void *tapdata _U_, packet_info *pinfo , epan_dissect_t *edt _U_ , const v if (datachunk || forwardchunk) { tsnumber = tvb_get_ntohl((sctp_info->tvb)[chunk_number], DATA_CHUNK_TSN_OFFSET); - if (tsn->first_tsn == 0) + if (tsn && tsn->first_tsn == 0) tsn->first_tsn = tsnumber; if (datachunk) { @@ -1085,7 +1085,7 @@ packet(void *tapdata _U_, packet_info *pinfo , epan_dissect_t *edt _U_ , const v { tsnumber = tvb_get_ntohl((sctp_info->tvb)[chunk_number], SACK_CHUNK_CUMULATIVE_TSN_ACK_OFFSET); length = tvb_get_ntohs(sctp_info->tvb[chunk_number], CHUNK_LENGTH_OFFSET); - if (sack->first_tsn == 0) + if (sack && sack->first_tsn == 0) sack->first_tsn = tsnumber; t_s_n = (guint8 *)g_malloc(length); tvb_memcpy(sctp_info->tvb[chunk_number], (guint8 *)(t_s_n),0, length); |