X-Git-Url: https://asedeno.scripts.mit.edu/gitweb/?a=blobdiff_plain;f=psftp.c;h=482d66ee41b94f3274abbda1301ff0c1c9470704;hb=e148dd97e3ab3417ef1ad424351d4af70a6cdd19;hp=d7b738129b4f0836f100fb824ff83e3d60d5f17d;hpb=947962e0b95e10151c186048a8b5cc2fb425838c;p=PuTTY.git diff --git a/psftp.c b/psftp.c index d7b73812..482d66ee 100644 --- a/psftp.c +++ b/psftp.c @@ -830,7 +830,17 @@ char *sftp_wildcard_get_filename(SftpWildcardMatcher *swcm) printf("%s: reading directory: %s\n", swcm->prefix, fxp_error()); return NULL; - } + } else if (swcm->names->nnames == 0) { + /* + * Another failure mode which we treat as EOF is if + * the server reports success from FXP_READDIR but + * returns no actual names. This is unusual, since + * from most servers you'd expect at least "." and + * "..", but there's nothing forbidding a server from + * omitting those if it wants to. + */ + return NULL; + } swcm->namepos = 0; }