PVS-StudioWarnings

PVS-Studio warning V557 for WebRTC

Nov 19th, 2014
164
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.60 KB | None | 0 0
  1. cc_string_t lineLabels[MAX_CONFIG_LINES+1] = {0};
  2.  
  3. void ccsnap_set_line_label(int btn, cc_string_t label) {
  4.   ....
  5.   if ( btn > 0 && btn <= MAX_CONFIG_LINES+1 ) {
  6.     ....
  7.     if ( lineLabels[btn] == NULL ) {
  8.     ....
  9.   }
  10.   ....
  11. }
  12.  
  13. This suspicious code was found in WebRTC project by PVS-Studio static code analyzer.
  14. Warning message is:
  15. V557 Array overrun is possible. The value of 'btn' index could reach 52. ccapi_snapshot.c 38
  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