[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Discuss-gnuradio] Fwd: New Defects reported by Coverity Scan for GN
From: |
Tom Rondeau |
Subject: |
Re: [Discuss-gnuradio] Fwd: New Defects reported by Coverity Scan for GNURadio |
Date: |
Mon, 3 Mar 2014 17:00:37 -0500 |
On Mon, Mar 3, 2014 at 4:58 PM, Philip Balister <address@hidden> wrote:
> The latest Coverity scan showed these new items. We should probably
> double check them. The Null dereference is likely related to the order
> in which some class methods get called.
>
> The compare against zero of an unsigned number should be checked to make
> sure that is what was really meant.
>
> Philip
Too late. I already pushed fixes for these and updated Coverity.
I noticed the defect emails and it's related to code I just pushed
this weekend, so it was easy enough for me to get them while they were
fresh in my mind.
Thanks for keeping on top of this, though.
Tom
> ** CID 1189412: Explicit null dereferenced (FORWARD_NULL)
> /var/lib/jenkins/jobs/GNURadio-master/workspace/gnuradio/gr-filter/lib/fft_filter.cc:
> 355 in gr::filter::kernel::fft_filter_ccf::fft_filter_ccf(int, const
> std::vector<float, std::allocator<float>> &, int)()
>
> ** CID 1189413: Unsigned compared against 0 (NO_EFFECT)
> /var/lib/jenkins/jobs/GNURadio-master/workspace/gnuradio/gr-filter/lib/pfb_synthesizer_ccf_impl.cc:
> 225 in gr::filter::pfb_synthesizer_ccf_impl::set_channel_map(const
> std::vector<int, std::allocator<int>> &)()
>
>
> ________________________________________________________________________________________________________
> *** CID 1189412: Explicit null dereferenced (FORWARD_NULL)
> /var/lib/jenkins/jobs/GNURadio-master/workspace/gnuradio/gr-filter/lib/fft_filter.cc:
> 355 in gr::filter::kernel::fft_filter_ccf::fft_filter_ccf(int, const
> std::vector<float, std::allocator<float>> &, int)()
> 349
> /**************************************************************/
> 350
> 351
> 352 fft_filter_ccf::fft_filter_ccf(int decimation,
> 353 const std::vector<float> &taps,
> 354 int nthreads)
>>>> CID 1189412: Explicit null dereferenced (FORWARD_NULL)
>>>> Assigning: "this->d_fwdfft" = "NULL".
> 355 : d_fftsize(-1), d_decimation(decimation), d_fwdfft(0),
> 356 d_invfft(0), d_nthreads(nthreads), d_xformed_taps(NULL)
> 357 {
> 358 set_taps(taps);
> 359 }
> 360
>
> ________________________________________________________________________________________________________
> *** CID 1189413: Unsigned compared against 0 (NO_EFFECT)
> /var/lib/jenkins/jobs/GNURadio-master/workspace/gnuradio/gr-filter/lib/pfb_synthesizer_ccf_impl.cc:
> 225 in gr::filter::pfb_synthesizer_ccf_impl::set_channel_map(const
> std::vector<int, std::allocator<int>> &)()
> 219 {
> 220 gr::thread::scoped_lock guard(d_mutex);
> 221
> 222 if(map.size() > 0) {
> 223 unsigned int max = (unsigned
> int)*std::max_element(map.begin(), map.end());
> 224 unsigned int min = (unsigned
> int)*std::min_element(map.begin(), map.end());
>>>> CID 1189413: Unsigned compared against 0 (NO_EFFECT)
>>>> This less-than-zero comparison of an unsigned value is never true.
>>>> "min < 0U".
> 225 if((max >= d_twox*d_numchans) || (min < 0)) {
> 226 throw
> std::invalid_argument("pfb_synthesizer_ccf_impl::set_channel_map: map
> range out of bounds.\n");
> 227 }
> 228 d_channel_map = map;
> 229
> 230 // Zero out fft buffer so that unused channels are always 0
>
> _______________________________________________
> Discuss-gnuradio mailing list
> address@hidden
> https://lists.gnu.org/mailman/listinfo/discuss-gnuradio