PVS-StudioWarnings

PVS-Studio warning V614 for Apache

Nov 11th, 2014
162
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.63 KB | None | 0 0
  1. static int warrsztoastr(const char * const * *retarr,
  2.                         const wchar_t * arrsz, int args)
  3. {
  4.   const apr_wchar_t *wch;
  5.   ....
  6.  
  7.   if (args < 0) {
  8.     for (args = 1, wch = arrsz; wch[0] || wch[1]; ++wch)
  9.       if (!*wch)
  10.        ++args;
  11.   }
  12.   wsize = 1 + wch - arrsz;
  13.   ....
  14. }
  15.  
  16. This suspicious code was found in Apache project by PVS-Studio static code analyzer.
  17. Warning message is:
  18. V614 Potentially uninitialized pointer 'wch' used. apr start.c 58
  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