Fix length in snprintf invocation to account for "dn:" in sasl gssapi bind.
authorJim McDonough <jmcd@samba.org>
Mon, 8 Jul 2002 20:46:54 +0000 (20:46 +0000)
committerJim McDonough <jmcd@samba.org>
Mon, 8 Jul 2002 20:46:54 +0000 (20:46 +0000)
Also remove unused line which incremented pointer by the wrong length anyway.

Provided by Anthony Liguori (aliguori@us.ibm.com).
(This used to be commit 47b7a3e0f3d101a3bcffd33db6ef4c0672b57ae0)

source3/libads/sasl.c

index eb29c71fce2ebcb5cd2f38bc31e90df0f3d5fbee..1b55453cac9f2d780715a177c26eca74c37983b2 100644 (file)
@@ -171,8 +171,7 @@ ADS_STATUS ads_sasl_gssapi_bind(ADS_STRUCT *ads)
        *p++ = max_msg_size>>16;
        *p++ = max_msg_size>>8;
        *p++ = max_msg_size;
-       snprintf(p, strlen(ads->bind_path)+1, "dn:%s", ads->bind_path);
-       p += strlen(ads->bind_path);
+       snprintf(p, strlen(ads->bind_path)+4, "dn:%s", ads->bind_path);
 
        output_token.length = strlen(ads->bind_path) + 8;