PVS-StudioWarnings

PVS-Studio warning V557 for OpenMS

Nov 11th, 2014
156
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.90 KB | None | 0 0
  1. DoubleReal masse_[255]; ///< mass table
  2.  
  3. EdwardsLippertIterator::EdwardsLippertIterator(
  4.     const EdwardsLippertIterator & source) :
  5.   PepIterator(source),
  6.   f_file_(source.f_file_),
  7.   actual_pep_(source.actual_pep_),
  8.   spec_(source.spec_),
  9.   tol_(source.tol_),
  10.   is_at_end_(source.is_at_end_),
  11.   f_iterator_(source.f_iterator_),
  12.   f_entry_(source.f_entry_),
  13.   b_(source.b_),
  14.   e_(source.e_),
  15.   m_(source.m_),
  16.   massMax_(source.massMax_)
  17. {
  18.   for (Size i = 0; i < 256; i++)
  19.   {
  20.     masse_[i] = source.masse_[i];
  21.   }
  22. }
  23.  
  24. This suspicious code was found in OpenMS project by PVS-Studio static code analyzer.
  25. Warning message is:
  26. V557 Array overrun is possible. The value of 'i' index could reach 255. edwardslippertiterator.c 134
  27.  
  28. PVS-Studio is a static analyzer for detecting bugs in the source code of applications written in C, C++, C++11, C++/CX. Site: http://www.viva64.com/en/pvs-studio/
Advertisement
Add Comment
Please, Sign In to add comment