Fix bug #5953 - smbclient crashes: cli_list_new segmentation fault.
authorJeremy Allison <jra@samba.org>
Mon, 8 Dec 2008 22:24:38 +0000 (14:24 -0800)
committerJeremy Allison <jra@samba.org>
Mon, 8 Dec 2008 22:24:38 +0000 (14:24 -0800)
Jeremy.

source3/libsmb/clilist.c

index 50918458b081010b8211493e1fbf23fea9340fd3..cebafc6919a0d522f38f6ca6a1704a4050746a30 100644 (file)
@@ -417,7 +417,7 @@ int cli_list_new(struct cli_state *cli,const char *Mask,uint16 attribute,
                }
 
                SAFE_FREE(mask);
-               if (ff_searchcount > 0) {
+               if (ff_searchcount > 0 && ff_eos == 0 && finfo.name) {
                        mask = SMB_STRDUP(finfo.name);
                } else {
                        mask = SMB_STRDUP("");