PVS-StudioWarnings

PVS-Studio warning V557 for WebRTC

Nov 25th, 2014
214
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.78 KB | None | 0 0
  1. #define MAX_CCMS 4
  2.  
  3. ccm_cfg_t   ccm[MAX_CCMS];
  4.  
  5. var_t prot_cfg_table[CFGID_PROTOCOL_MAX+1] = {
  6.   ....
  7.   {"ccmSrstIpAddr",   CFGVAR(ccm[4].address), PA_STR, PR_STR, 0},
  8.   {"ccmSrst_sipPort", CFGVAR(ccm[4].sip_port),PA_INT, PR_INT, 0},
  9.   {"ccmSrst_isValid", CFGVAR(ccm[4].is_valid),PA_INT, PR_INT, 0},
  10.   {"ccmSrst_securityLevel",
  11.                     CFGVAR(ccm[4].sec_level), PA_INT, PR_INT, 0},
  12.   ....
  13. };
  14.  
  15. This suspicious code was found in WebRTC project by PVS-Studio static code analyzer.
  16. Warning message is:
  17. V557 Array overrun is possible. The '4' index is pointing beyond array bound. prot_cfgmgr_private.h 357
  18.  
  19. 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