PVS-StudioWarnings

PVS-Studio warning V579 for Firebird

Nov 25th, 2014
184
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.82 KB | None | 0 0
  1. ULONG convert(const ULONG srcLen,
  2.               const UCHAR* src,
  3.               const ULONG dstLen,
  4.               UCHAR* dst,
  5.               ULONG* badInputPos = NULL,
  6.               bool ignoreTrailingSpaces = false);
  7.  
  8. string IntlUtil::escapeAttribute(....)
  9. {
  10.   ....
  11.   ULONG l;
  12.   UCHAR* uc = (UCHAR*)(&l);
  13.   const ULONG uSize =
  14.     cs->getConvToUnicode().convert(size, p, sizeof(uc), uc);
  15.   ....
  16. }
  17.  
  18. This suspicious code was found in Firebird project by PVS-Studio static code analyzer.
  19. Warning message is:
  20. V579 The convert function receives the pointer and its size as arguments. It is possibly a mistake. Inspect the third argument. intlutil.cpp 668
  21.  
  22. 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