PVS-StudioWarnings

PVS-Studio warning V576 for WebRTC

Nov 20th, 2014
156
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.69 KB | None | 0 0
  1. int32_t TraceWindows::AddDateTimeInfo(char* trace_message) const
  2. {
  3.   ....
  4.   TCHAR sz_date_str[20];
  5.   TCHAR sz_time_str[20];
  6.   ....
  7.   sprintf(trace_message,
  8.           "Local Date: %s Local Time: %s",
  9.           sz_date_str,
  10.           sz_time_str);
  11.   ....
  12. }
  13.  
  14. This suspicious code was found in WebRTC project by PVS-Studio static code analyzer.
  15. Warning message is:
  16. V576 Incorrect format. Consider checking the third actual argument of the 'sprintf' function. The pointer to string of char type symbols is expected. trace_win.cc 112
  17.  
  18. 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