s3-tldap: Fix dead code in tldap_sasl_bind_send().
authorAndreas Schneider <asn@samba.org>
Mon, 17 Dec 2012 13:21:01 +0000 (14:21 +0100)
committerGünther Deschner <gd@samba.org>
Fri, 21 Dec 2012 12:56:00 +0000 (13:56 +0100)
dn can't be NULL cause it is set to "" in that case.

Found by Coverity.

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Günther Deschner <gd@samba.org>
source3/lib/tldap.c

index 8b04d0063675e137c6fd2d25fba42bfd229f8081..765580fd81d854c35ee01c8161cccfba46a65a6c 100644 (file)
@@ -817,7 +817,7 @@ struct tevent_req *tldap_sasl_bind_send(TALLOC_CTX *mem_ctx,
 
        asn1_push_tag(state->out, TLDAP_REQ_BIND);
        asn1_write_Integer(state->out, ld->ld_version);
-       asn1_write_OctetString(state->out, dn, (dn != NULL) ? strlen(dn) : 0);
+       asn1_write_OctetString(state->out, dn, strlen(dn));
 
        if (mechanism == NULL) {
                asn1_push_tag(state->out, ASN1_CONTEXT_SIMPLE(0));