Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- bool equals( class1* val1, class2* val2 ) const{
- {
- ...
- size_t size = val1->size();
- ...
- while ( --size >= 0 ){
- if ( !comp(*itr1,*itr2) )
- return false;
- itr1++;
- itr2++;
- }
- ...
- }
- An array overrun may surely occur.
- This suspicious code was found in QT project by PVS-Studio static code analyzer.
- Warning message is:
- V547 Expression '-- size >= 0' is always true. Unsigned type value is always >= 0. QtCLucene arrays.h 154
- 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