aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPascal Quantin <pascal.quantin@gmail.com>2017-08-30 16:48:30 +0200
committerMichael Mann <mmann78@netscape.net>2017-08-30 16:00:07 +0000
commit94ce35a9f9877d3e48db3d800f2493f9944e1b5e (patch)
treea71f46accb753cada86ff0134c01bee109b6eb83
parent71697c5dab92e5be15180c6fb4420fd847e1e539 (diff)
Qt: check QVector size before accessing its content and not after
Bug: 14017 Change-Id: Ied38551c78b4593f60165d9e3b04bb3913d6b258 Reviewed-on: https://code.wireshark.org/review/23310 Reviewed-by: Pascal Quantin <pascal.quantin@gmail.com> Petri-Dish: Pascal Quantin <pascal.quantin@gmail.com> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Michael Mann <mmann78@netscape.net>
-rw-r--r--ui/qt/tcp_stream_dialog.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/ui/qt/tcp_stream_dialog.cpp b/ui/qt/tcp_stream_dialog.cpp
index baa50ed1b9..84c563aeac 100644
--- a/ui/qt/tcp_stream_dialog.cpp
+++ b/ui/qt/tcp_stream_dialog.cpp
@@ -1205,7 +1205,7 @@ void TCPStreamDialog::fillThroughput()
r_lens.append(seglen);
#ifdef MA_1_SECOND
- while (ts - r_pkt_times[r_oldest] > ma_window_size_ && r_oldest < r_pkt_times.size()) {
+ while (r_oldest < r_pkt_times.size() && ts - r_pkt_times[r_oldest] > ma_window_size_) {
r_sum -= r_lens[r_oldest];
// append points where a packet LEAVES the MA window
// (as well as, below, where they ENTER the MA window)