libcli-cldap: avoid the case local == remote == NULL (cherry picked from commit 4d2d3...
[ddiss/samba.git] / libcli / cldap / cldap.c
index 443292113ef4d8c56b7c3cd796f48f66e03b0501..363ffbd1dc5a6c1c3182b18fab50dc08a8691453 100644 (file)
@@ -351,8 +351,12 @@ NTSTATUS cldap_socket_init(TALLOC_CTX *mem_ctx,
 
        if (!local_addr) {
                /*
-                * Here we the address family of the remote address.
+                * Here we know the address family of the remote address.
                 */
+               if (fam == NULL) {
+                       return NT_STATUS_INVALID_PARAMETER_MIX;
+               }
+
                ret = tsocket_address_inet_from_strings(c, fam,
                                                        NULL, 0,
                                                        &any);