Browse Source

Bug 622628 - fix coverity Defect Type: Integer handling issues

https://bugzilla.redhat.com/show_bug.cgi?id=622628

Comment:
This is a typo where a bitwise AND was used instead of a logical AND
on line 2185. The issue is not serious, as it only affect the "number
of operations" counter for ldclt.  The second half of the condition
is not even needed in fact, since we are guaranteed that "(ret ==
LDAP_ALREADY_EXISTS)" is true at line 2185.

Fix Description:
Based upon the comment, removing the unnecessary second half of
the condition.
Noriko Hosoi 15 years ago
parent
commit
700ca9fe54
1 changed files with 3 additions and 1 deletions
  1. 3 1
      ldap/servers/slapd/tools/ldclt/ldapfct.c

+ 3 - 1
ldap/servers/slapd/tools/ldclt/ldapfct.c

@@ -2182,11 +2182,13 @@ createMissingNodes (
 #endif								/*JLS 14-11-00*/
 #endif								/*JLS 14-11-00*/
   }
   }
   else								/*JLS 15-12-00*/
   else								/*JLS 15-12-00*/
-    if ((mctx.mode & COUNT_EACH) & (ret == LDAP_ALREADY_EXISTS))/*JLS 15-12-00*/
+  {
+    if (mctx.mode & COUNT_EACH)		/*JLS 15-12-00*/
     {								/*JLS 15-12-00*/
     {								/*JLS 15-12-00*/
       if (incrementNbOpers (tttctx) < 0)			/*JLS 15-12-00*/
       if (incrementNbOpers (tttctx) < 0)			/*JLS 15-12-00*/
 	return (-1);						/*JLS 15-12-00*/
 	return (-1);						/*JLS 15-12-00*/
     }								/*JLS 15-12-00*/
     }								/*JLS 15-12-00*/
+  }
 
 
   /*
   /*
    * Ok, we succeed to create the entry ! or it already exist.
    * Ok, we succeed to create the entry ! or it already exist.