PVS-StudioWarnings

PVS-Studio warning V512 for FCEUX

Nov 20th, 2014
173
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.62 KB | None | 0 0
  1. static uint8 bdata[20];
  2.  
  3. static void Update(void *data, int arg)
  4. {
  5.  if(*(uint8 *)data)
  6.  {
  7.   *(uint8 *)data=0;
  8.   seq=ptr=0;
  9.   have=1;
  10.   strcpy((char*)bdata,(char *)data+1);
  11.   strcpy((char*)&bdata[13],"SUNSOFT");
  12.  }
  13. }
  14.  
  15. This suspicious code was found in FCEUX project by PVS-Studio static code analyzer.
  16. Warning message is:
  17. V512 A call of the 'strcpy' function will lead to overflow of the buffer '(char *) & bdata[13]'. - ADDITIONAL IN CURRENT bworld.cpp 64
  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