summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPhilip Balister <philip@balister.org>2018-11-02 16:59:26 -0400
committerPhilip Balister <philip@balister.org>2018-11-02 16:59:26 -0400
commit313811184ae4be5829991832b6b04a0fe08a06af (patch)
treea7df1f8f0db1f7a905f4c183b4bbc67957fae8c6
parente07751acc8424f4dd987f79c32dd247ed347902c (diff)
const_sink_c_impl.cc: Address Coverity issue 1396500.
Loop iterates through the entire array, however the _test_trigger_slope function operates on the index and index + 1 elements. Limit the loop counter to prevent accessing one element beyond the end of the array. Signed-off-by: Philip Balister <philip@balister.org>
-rw-r--r--gr-qtgui/lib/const_sink_c_impl.cc2
1 files changed, 1 insertions, 1 deletions
diff --git a/gr-qtgui/lib/const_sink_c_impl.cc b/gr-qtgui/lib/const_sink_c_impl.cc
index af9cc1034a..1ed4f3b1d5 100644
--- a/gr-qtgui/lib/const_sink_c_impl.cc
+++ b/gr-qtgui/lib/const_sink_c_impl.cc
@@ -450,7 +450,7 @@ namespace gr {
{
int trigger_index;
const gr_complex *in = (const gr_complex*)inputs[d_trigger_channel];
- for(trigger_index = 0; trigger_index < nitems; trigger_index++) {
+ for(trigger_index = 0; trigger_index < nitems - 1; trigger_index++) {
d_trigger_count++;
// Test if trigger has occurred based on the input stream,