PVS-StudioWarnings

PVS-Studio warning V517 for WebRTC

Nov 18th, 2014
187
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.84 KB | None | 0 0
  1. sipMethod_t
  2. sippmh_get_method_code (const char *method)
  3. {
  4.   ....
  5.   else if (strcmp(method, SIP_METHOD_INFO) == 0)     <<<<====
  6.     ret = sipMethodInfo;
  7.   else if (strcmp(method, SIP_METHOD_PUBLISH) == 0)
  8.     ret = sipMethodPublish;
  9.   else if (strcmp(method, SIP_METHOD_MESSAGE) == 0)
  10.     ret = sipMethodMessage;
  11.   else if (strcmp(method, SIP_METHOD_INFO) == 0)     <<<<====
  12.     ret = sipMethodInfo;
  13.   ....
  14. }
  15.  
  16. This suspicious code was found in WebRTC project by PVS-Studio static code analyzer.
  17. Warning message is:
  18. V517 The use of 'if (A) {...} else if (A) {...}' pattern was detected. There is a probability of logical error presence. Check lines: 196, 202. ccsip_pmh.c 196
  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