summaryrefslogtreecommitdiffstats
path: root/source3
diff options
context:
space:
mode:
authorGerald Carter <jerry@samba.org>2004-05-07 15:59:13 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 10:51:29 -0500
commit3bbf2f1e0a9078b6888866979642962c8b8a90af (patch)
tree6ab30bf8070675ee3cf70f0f7b321a138a9b3eff /source3
parentba8a59dbf43a18bb93007b22758cfe5f9882dd3e (diff)
downloadsamba-3bbf2f1e0a9078b6888866979642962c8b8a90af.tar.gz
samba-3bbf2f1e0a9078b6888866979642962c8b8a90af.tar.xz
samba-3bbf2f1e0a9078b6888866979642962c8b8a90af.zip
r557: another patch from Stephan Kulow <coolo@suse.de> -- check cli * before dereferencing it
(This used to be commit c385fb467fc2a669d54b9a2faddbf66f9e4699c6)
Diffstat (limited to 'source3')
-rw-r--r--source3/libsmb/libsmbclient.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/source3/libsmb/libsmbclient.c b/source3/libsmb/libsmbclient.c
index 50af2237269..2ef054473ba 100644
--- a/source3/libsmb/libsmbclient.c
+++ b/source3/libsmb/libsmbclient.c
@@ -1991,6 +1991,12 @@ static SMBCFILE *smbc_opendir_ctx(SMBCCTX *context, const char *fname)
DEBUG(99, ("Found master browser %s\n", inet_ntoa(ip_list[i].ip)));
cli = get_ipc_connect_master_ip(&ip_list[i], workgroup, &u_info);
+
+ /* cli == NULL is the master browser refused to talk or
+ could not be found */
+ if ( !cli )
+ continue;
+
fstrcpy(server, cli->desthost);
cli_shutdown(cli);