r10579: str_list_make() can return NULL
authorJelmer Vernooij <jelmer@samba.org>
Wed, 28 Sep 2005 14:12:09 +0000 (14:12 +0000)
committerGerald (Jerry) Carter <jerry@samba.org>
Wed, 10 Oct 2007 18:39:07 +0000 (13:39 -0500)
source/auth/auth_sam.c
source/lib/util_sock.c

index a6db8ef63d686d682f117482bc69985fe3fe8bfa..1df2103eb6269b3759d0df40d9959d00d13770c4 100644 (file)
@@ -163,7 +163,7 @@ static NTSTATUS authsam_account_ok(TALLOC_CTX *mem_ctx,
                int i;
                const char **workstations = str_list_make(mem_ctx, workstation_list, ",");
                
-               for (i = 0; workstations[i]; i++) {
+               for (i = 0; workstations && workstations[i]; i++) {
                        DEBUG(10,("sam_account_ok: checking for workstation match '%s' and '%s'\n",
                                  workstations[i], user_info->workstation_name));
 
index be968666a79a01f1d6faf6be44f9019be87fc092..8a65a27d020dd33ae421fb4bbb02cd8b22f46b5e 100644 (file)
@@ -75,6 +75,9 @@ void set_socket_options(int fd, const char *options)
        const char **options_list = str_list_make(NULL, options, " \t,");
        int j;
 
+       if (!options_list)
+               return;
+
        for (j = 0; options_list[j]; j++) {
                const char *tok = options_list[j];
                int ret=0,i;