s3-rpcclient: fix uninitialized variable in wkssvc_enumerateusers.
authorGünther Deschner <gd@samba.org>
Wed, 17 Feb 2010 14:15:47 +0000 (15:15 +0100)
committerGünther Deschner <gd@samba.org>
Thu, 18 Feb 2010 00:47:57 +0000 (01:47 +0100)
Guenther

source3/rpcclient/cmd_wkssvc.c

index 34ad57650c02a6c84035fa5f94be108528a11471..147501049aef620ce3f199095b4147e06c1d0c9e 100644 (file)
@@ -190,7 +190,7 @@ static WERROR cmd_wkssvc_enumerateusers(struct rpc_pipe_client *cli,
        }
 
        for (i=0; i<num_entries; i++) {
        }
 
        for (i=0; i<num_entries; i++) {
-               const char *user;
+               const char *user = NULL;
                switch (info.level) {
                case 0:
                        user = info.ctr.user0->user0[i].user_name;
                switch (info.level) {
                case 0:
                        user = info.ctr.user0->user0[i].user_name;
@@ -202,7 +202,7 @@ static WERROR cmd_wkssvc_enumerateusers(struct rpc_pipe_client *cli,
                                info.ctr.user1->user1[i].user_name);
                        break;
                }
                                info.ctr.user1->user1[i].user_name);
                        break;
                }
-               printf("%s\n", user);
+               printf("%s\n", user ? user : "(null)");
        }
 
        return werr;
        }
 
        return werr;