PVS-StudioWarnings

PVS-Studio warning V501 for samba

Nov 18th, 2014
166
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.83 KB | None | 0 0
  1. static char *sddl_encode_ace(TALLOC_CTX *mem_ctx,
  2.                              const struct security_ace *ace,
  3.                              const struct dom_sid *domain_sid)
  4. {
  5.   ....
  6.   if (ace->type == SEC_ACE_TYPE_ACCESS_ALLOWED_OBJECT ||
  7.       ace->type == SEC_ACE_TYPE_ACCESS_DENIED_OBJECT ||
  8.       ace->type == SEC_ACE_TYPE_SYSTEM_AUDIT_OBJECT ||
  9.       ace->type == SEC_ACE_TYPE_SYSTEM_AUDIT_OBJECT) {
  10.   ....
  11. }
  12.  
  13. This suspicious code was found in samba project by PVS-Studio static code analyzer.
  14. Warning message is:
  15. V501 There are identical sub-expressions 'ace->type == SEC_ACE_TYPE_SYSTEM_AUDIT_OBJECT' to the left and to the right of the '||' operator. sddl.c 528
  16.  
  17. 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