PVS-StudioWarnings

PVS-Studio warning V547 for Asterisk

Nov 12th, 2014
156
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.64 KB | None | 0 0
  1. static int ebl_callback(....)
  2. {
  3.   unsigned int i;
  4.   ....
  5.   if ((i = dn_expand((unsigned char *)fullanswer,
  6.      (unsigned char *)answer + len,
  7.      (unsigned char *)answer, c->apex, sizeof(c->apex) - 1)) < 0)
  8.   {
  9.     ast_log(LOG_WARNING, "Failed to expand hostname\n");
  10.     return 0;
  11.   }
  12. }
  13.  
  14. This suspicious code was found in Asterisk project by PVS-Studio static code analyzer.
  15. Warning message is:
  16. V547 Expression is always false. Unsigned type value is never < 0. enum.c 309
  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