s4-socket: detect NULL server in socket connection code
authorAndrew Tridgell <tridge@samba.org>
Mon, 7 Nov 2011 04:19:09 +0000 (15:19 +1100)
committerAndrew Tridgell <tridge@samba.org>
Thu, 10 Nov 2011 03:24:20 +0000 (14:24 +1100)
return NT_STATUS_NOT_FOUND instead of a segfault

Pair-Programmed-With: Amitay Isaacs <amitay@gmail.com>

source4/lib/socket/connect_multi.c

index 96277a6..5358606 100644 (file)
@@ -132,6 +132,11 @@ static void connect_multi_next_socket(struct composite_context *result)
 
        multi->num_connects_sent += 1;
 
+       if (multi->server_address == NULL) {
+               composite_error(result, NT_STATUS_OBJECT_NAME_NOT_FOUND);
+               return;
+       }
+
        state = talloc(multi, struct connect_one_state);
        if (composite_nomem(state, result)) return;