From 0c5b0470f4f1c2265e18ed8d28ca71396ae5b543 Mon Sep 17 00:00:00 2001 From: Gerald Carter Date: Fri, 7 May 2004 15:59:13 +0000 Subject: [PATCH] r557: another patch from Stephan Kulow -- check cli * before dereferencing it --- source/libsmb/libsmbclient.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/source/libsmb/libsmbclient.c b/source/libsmb/libsmbclient.c index 50af2237269..2ef054473ba 100644 --- a/source/libsmb/libsmbclient.c +++ b/source/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); -- 2.11.4.GIT