From 3bbf2f1e0a9078b6888866979642962c8b8a90af Mon Sep 17 00:00:00 2001 From: Gerald Carter Date: Fri, 7 May 2004 15:59:13 +0000 Subject: r557: another patch from Stephan Kulow -- check cli * before dereferencing it (This used to be commit c385fb467fc2a669d54b9a2faddbf66f9e4699c6) --- source3/libsmb/libsmbclient.c | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'source3/libsmb') diff --git a/source3/libsmb/libsmbclient.c b/source3/libsmb/libsmbclient.c index 50af223726..2ef054473b 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); -- cgit