Advertisement
PVS-StudioWarnings

PVS-Studio warning V576 for Scilab

Nov 25th, 2014
153
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.71 KB | None | 0 0
  1. DWORD dwMemoryLoad;
  2.  
  3. char **getDynamicDebugInfo_Windows(int *sizeArray)
  4. {
  5.   ....
  6.   str_info = (char*)MALLOC(sizeof(char)*BUFFER_LEN);
  7.   if (str_info)
  8.   {
  9.     sprintf(str_info,
  10.         "Memory in use: %*ld %%",
  11.         WIDTH,
  12.         statex.dwMemoryLoad);
  13.   ......
  14. }
  15.  
  16. This suspicious code was found in Scilab project by PVS-Studio static code analyzer.
  17. Warning message is:
  18. V576 Incorrect format. Consider checking the fourth actual argument of the 'sprintf' function. The SIGNED integer type argument is expected. getdynamicdebuginfo_windows.c 62
  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