aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKamil Dudka <kdudka@redhat.com>2010-06-02 23:22:38 +0200
committerKamil Dudka <kdudka@redhat.com>2010-06-02 23:50:38 +0200
commit475c19c42b01ab23da7a90551d1b07d2ebfd2e5d (patch)
tree140479090fa7efc490aed99cbae1ce2eff6da596
parentc072bd460992355217c9077e2d33152ca0007e8f (diff)
ftplistparser.c: avoid some invalid dereferences
-rw-r--r--lib/ftplistparser.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/lib/ftplistparser.c b/lib/ftplistparser.c
index 65addfaa1..c5a2f8c45 100644
--- a/lib/ftplistparser.c
+++ b/lib/ftplistparser.c
@@ -341,7 +341,7 @@ static CURLcode ftp_pl_insert_finfo(struct connectdata *conn,
/* filter pattern-corresponding filenames */
if(compare(conn->data->set.fnmatch_data, wc->pattern, finfo->filename) == 0) {
/* discard symlink which is containing multiple " -> " */
- if((finfo->filetype == CURLFILETYPE_SYMLINK) &&
+ if((finfo->filetype == CURLFILETYPE_SYMLINK) && finfo->strings.target
(strstr(finfo->strings.target, " -> "))) {
add = FALSE;
}
@@ -424,6 +424,9 @@ size_t ftp_parselist(char *buffer, size_t size, size_t nmemb, void *connptr)
else {
Curl_fileinfo_dtor(NULL, parser->file_data);
parser->file_data = NULL;
+ parser->error = CURLE_OUT_OF_MEMORY;
+ PL_ERROR(conn, CURLE_OUT_OF_MEMORY);
+ return bufflen;
}
}
@@ -937,7 +940,7 @@ size_t ftp_parselist(char *buffer, size_t size, size_t nmemb, void *connptr)
PL_ERROR(conn, CURLE_FTP_BAD_FILE_LIST);
return bufflen;
}
- /* correct file size */
+ /* correct file type */
parser->file_data->filetype = CURLFILETYPE_FILE;
}