Sfoglia il codice sorgente

610281 - fix coverity Defect Type: Control flow issues

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

11796 DEADCODE Triaged Unassigned Bug Minor Ignore
slapi_ldap_init_ext() ds/ldap/servers/slapd/ldaputil.c

Comment:
ldapurl is guaranteed not NULL.
323 slapi_log_error(SLAPI_LOG_FATAL, "slapi_ldap_init_ext",
324 "Could not parse given LDAP URL [%s] : error [%s]\n",
325 ldapurl ? ldapurl : "NULL",
326 slapi_urlparse_err2string(rc));

11797 DEADCODE Triaged Unassigned Bug Minor Ignore
slapi_ldap_bind() ds/ldap/servers/slapd/ldaputil.c

Comment:
It is guaranteed that mech has some value at the line 755.
755 slapi_log_error(SLAPI_LOG_FATAL, "slapi_ldap_bind",
756 "Error: could not perform interactive bind for id "
757 "[%s] mech [%s]: error %d (%s)\n",
758 bindid ? bindid : "(anon)",
759 mech ? mech : "SIMPLE",
760 rc, ldap_err2string(rc));
Noriko Hosoi 15 anni fa
parent
commit
de66a9e1a8
1 ha cambiato i file con 2 aggiunte e 2 eliminazioni
  1. 2 2
      ldap/servers/slapd/ldaputil.c

+ 2 - 2
ldap/servers/slapd/ldaputil.c

@@ -322,7 +322,7 @@ slapi_ldap_init_ext(
 		    !ludp)) {
 	slapi_log_error(SLAPI_LOG_FATAL, "slapi_ldap_init_ext",
 			"Could not parse given LDAP URL [%s] : error [%s]\n",
-			ldapurl ? ldapurl : "NULL",
+			ldapurl, /* ldapurl cannot be NULL here */
 			slapi_urlparse_err2string(rc));
 	goto done;
     }
@@ -756,7 +756,7 @@ slapi_ldap_bind(
 			    "Error: could not perform interactive bind for id "
 			    "[%s] mech [%s]: error %d (%s)\n",
 			    bindid ? bindid : "(anon)",
-			    mech ? mech : "SIMPLE",
+			    mech, /* mech cannot be SIMPLE here */
 			    rc, ldap_err2string(rc));
 	}
     }