s4-dnsserver: Handle the case when the dns name is NULL
authorAmitay Isaacs <amitay@gmail.com>
Mon, 24 Oct 2011 06:22:21 +0000 (17:22 +1100)
committerAndrew Tridgell <tridge@samba.org>
Wed, 2 Nov 2011 04:26:54 +0000 (15:26 +1100)
Signed-off-by: Andrew Tridgell <tridge@samba.org>
source4/rpc_server/dnsserver/dnsdata.c

index 2dacda7f494b2aa7fc01461cfb56d04aafb950bc..d9e708f4571be348535bae9281a9797719b01ce9 100644 (file)
@@ -128,6 +128,10 @@ int dns_split_name_components(TALLOC_CTX *tmp_ctx, const char *name, char ***com
        char *str = NULL, *ptr, **list;
        int count = 0;
 
+       if (name == NULL) {
+               return 0;
+       }
+
        str = talloc_strdup(tmp_ctx, name);
        if (!str) {
                goto failed;