Advertisement
PVS-StudioWarnings

PVS-Studio warning V557 for Word11a

Nov 21st, 2014
165
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.85 KB | None | 0 0
  1. uns rgwSpare0 [5];
  2.  
  3. DumpHeader()
  4. {
  5.   ....
  6.   printUns ("rgwSpare0[0]   = ", Fib.rgwSpare0[5], 0, 0, fTrue);
  7.   printUns ("rgwSpare0[1]   = ", Fib.rgwSpare0[1], 1, 1, fTrue);
  8.   printUns ("rgwSpare0[2]   = ", Fib.rgwSpare0[2], 0, 0, fTrue);
  9.   printUns ("rgwSpare0[3]   = ", Fib.rgwSpare0[3], 1, 1, fTrue);
  10.   printUns ("rgwSpare0[4]   = ", Fib.rgwSpare0[4], 2, 2, fTrue);
  11.   ....
  12. }
  13.  
  14. This is what should have been written here: printUns ("rgwSpare0[0]   = ", Fib.rgwSpare0[0], 0, 0, fTrue);
  15.  
  16. This suspicious code was found in Word11a project by PVS-Studio static code analyzer.
  17. Warning message is:
  18. V557 Array overrun is possible. The '5' index is pointing beyond array bound. dnatfile.c 444
  19.  
  20. 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
Advertisement