PVS-StudioWarnings

PVS-Studio warning V635 for WinMerge

Nov 12th, 2014
175
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.68 KB | None | 0 0
  1. int
  2. iconvert_new (LPCTSTR source, LPTSTR *destination,
  3.               int source_coding, int destination_coding,
  4.               bool alphabet_only)
  5. {
  6.   LPTSTR dest = (LPTSTR) malloc (_tcslen (source) + 1 + 10);
  7.   int result = -3;
  8.   if (dest)
  9.   {
  10.     _tcscpy (dest, source);
  11.     ....
  12. }
  13.  
  14. This suspicious code was found in WinMerge project by PVS-Studio static code analyzer.
  15. Warning message is:
  16. V635 Consider inspecting the expression. The length should probably be multiplied by the sizeof(wchar_t). cs2cs.cpp 236
  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