Advertisement
PVS-StudioWarnings

PVS-Studio warning V507 for Scilab

Nov 21st, 2014
154
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.72 KB | None | 0 0
  1. int sci_champ_G(....)
  2. {
  3.   ....
  4.   char * strf = NULL ;
  5.   ....
  6.   if ( isDefStrf( strf ) )
  7.   {
  8.     char strfl[4];
  9.     strcpy(strfl,DEFSTRFN);
  10.     strf = strfl;
  11.     if ( !isDefRect( rect ) )
  12.     {
  13.       strf[1]='5';
  14.     }
  15.   }
  16.  
  17.   (*func)(stk(l1 ),stk(l2 ),stk(l3 ),stk(l4 ),
  18.     &m3,&n3,strf,rect, arfact, 4L);
  19.   ....
  20. }
  21.  
  22. This suspicious code was found in Scilab project by PVS-Studio static code analyzer.
  23. Warning message is:
  24. V507 Pointer to local array 'strfl' is stored outside the scope of this array. Such a pointer will become invalid. sci_champ.c 103
  25.  
  26. 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