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 5091845..cebafc6 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("");