PVS-StudioWarnings

PVS-Studio warning V517 for Asterisk

Nov 21st, 2014
187
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.76 KB | None | 0 0
  1. static void channel_hangup_handler_cb(....)
  2. {
  3.   const char *event;
  4.   ....
  5.   if (!strcmp(action, "type")) {
  6.     event = "HangupHandlerRun";
  7.   } else if (!strcmp(action, "type")) {
  8.     event = "HangupHandlerPop";
  9.   } else if (!strcmp(action, "type")) {
  10.     event = "HangupHandlerPush";
  11.   } else {
  12.     return;
  13.   }
  14.   ....
  15. }
  16.  
  17. This suspicious code was found in Asterisk project by PVS-Studio static code analyzer.
  18. Warning message is:
  19. V517 The use of 'if (A) {...} else if (A) {...}' pattern was detected. There is a probability of logical error presence. Check lines: 851, 853. manager_channels.c 851
  20.  
  21. 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