PVS-StudioWarnings

PVS-Studio warning V522 for TPP

Nov 20th, 2014
177
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.58 KB | None | 0 0
  1. void ASAPRatio_getDataStrctRatio(dataStrct *data, ....)
  2. {
  3.   ....
  4.   int *outliers, *pepIndx=NULL;
  5.   ....
  6.   //pepIndx don't used
  7.   ....
  8.   if(data->dataCnts[i] == 1 && pepIndx[i] == 0)
  9.      data->dataCnts[i] = 0;
  10.   ....
  11. }
  12.  
  13. This suspicious code was found in TPP project by PVS-Studio static code analyzer.
  14. Warning message is:
  15. V522 Dereferencing of the null pointer 'pepIndx' might take place. asapcgidisplay2main.cxx 534
  16.  
  17. 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