Advertisement
PVS-StudioWarnings

PVS-Studio warning V547 for Apache

Nov 26th, 2014
170
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.67 KB | None | 0 0
  1. typedef UINT_PTR SOCKET;
  2.  
  3. static unsigned int __stdcall win9x_accept(void * dummy)
  4. {
  5.   SOCKET csd;
  6.   ...
  7.   do {
  8.       clen = sizeof(sa_client);
  9.       csd = accept(nsd, (struct sockaddr *) &sa_client, &clen);
  10.   } while (csd < 0 &&
  11.            APR_STATUS_IS_EINTR(apr_get_netos_error()));
  12.   ...
  13. }
  14.  
  15. This suspicious code was found in Apache project by PVS-Studio static code analyzer.
  16. Warning message is:
  17. V547 Expression 'csd < 0' is always false. Unsigned type value is never < 0. libhttpd child.c 404
  18.  
  19. 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