diff options
author | Pavel Raiskup <pavel@raiskup.cz> | 2010-05-15 21:58:50 +0200 |
---|---|---|
committer | Daniel Stenberg <daniel@haxx.se> | 2010-05-15 21:58:50 +0200 |
commit | e4af5d6efcf9c8ddae087009df1782d890a0e13b (patch) | |
tree | cf9e89a6b5bca657687c61b2482385d9235936ab /lib | |
parent | 43b816538fbbac07ca7ccc2dc647c972c3ee072a (diff) |
ftp wildcard: fix int32_t and size/group mixups
Diffstat (limited to 'lib')
-rw-r--r-- | lib/ftplistparser.c | 24 |
1 files changed, 8 insertions, 16 deletions
diff --git a/lib/ftplistparser.c b/lib/ftplistparser.c index 9d42e8f37..faf314fe2 100644 --- a/lib/ftplistparser.c +++ b/lib/ftplistparser.c @@ -465,7 +465,7 @@ size_t ftp_parselist(char *buffer, size_t size, size_t nmemb, void *connptr) } } else if(parser->item_length == 10) { - int32_t perm; + unsigned int perm; if(c != ' ') { PL_ERROR(conn, CURLE_FTP_BAD_FILE_LIST); return bufflen; @@ -560,7 +560,7 @@ size_t ftp_parselist(char *buffer, size_t size, size_t nmemb, void *connptr) finfo->b_data[parser->item_offset + parser->item_length - 1] = 0; parser->offsets.group = parser->item_offset; parser->state.UNIX.main = PL_UNIX_SIZE; - parser->state.UNIX.sub.group = PL_UNIX_SIZE_PRESPACE; + parser->state.UNIX.sub.size = PL_UNIX_SIZE_PRESPACE; parser->item_offset = 0; parser->item_length = 0; } @@ -624,7 +624,7 @@ size_t ftp_parselist(char *buffer, size_t size, size_t nmemb, void *connptr) case PL_UNIX_TIME_PART1: parser->item_length++; if(c == ' ') { - parser->state.UNIX.sub.size = PL_UNIX_TIME_PREPART2; + parser->state.UNIX.sub.time = PL_UNIX_TIME_PREPART2; } else if(!ISALNUM(c) && c != '.') { PL_ERROR(conn, CURLE_FTP_BAD_FILE_LIST); @@ -646,7 +646,7 @@ size_t ftp_parselist(char *buffer, size_t size, size_t nmemb, void *connptr) case PL_UNIX_TIME_PART2: parser->item_length++; if(c == ' ') { - parser->state.UNIX.sub.size = PL_UNIX_TIME_PREPART3; + parser->state.UNIX.sub.time = PL_UNIX_TIME_PREPART3; } else if(!ISALNUM(c) && c != '.') { PL_ERROR(conn, CURLE_FTP_BAD_FILE_LIST); @@ -917,21 +917,13 @@ size_t ftp_parselist(char *buffer, size_t size, size_t nmemb, void *connptr) finfo->size = curlx_strtoofft(finfo->b_data + parser->item_offset, &endptr, 10); if(!*endptr) { - if(finfo->size < CURL_LLONG_MAX && - finfo->size > CURL_LLONG_MIN) { - - } - else if(finfo->size == CURL_LLONG_MAX || - finfo->size == CURL_LLONG_MIN) { + if(finfo->size == CURL_LLONG_MAX || + finfo->size == CURL_LLONG_MIN) { if(errno == ERANGE) { PL_ERROR(conn, CURLE_FTP_BAD_FILE_LIST); return bufflen; } } - else { - PL_ERROR(conn, CURLE_FTP_BAD_FILE_LIST); - return bufflen; - } } else { PL_ERROR(conn, CURLE_FTP_BAD_FILE_LIST); @@ -974,7 +966,7 @@ size_t ftp_parselist(char *buffer, size_t size, size_t nmemb, void *connptr) return bufflen; } parser->state.NT.main = PL_WINNT_DATE; - parser->state.NT.sub.filename = 0; + parser->state.NT.sub.filename = PL_WINNT_FILENAME_PRESPACE; } break; case PL_WINNT_FILENAME_WINEOL: @@ -986,7 +978,7 @@ size_t ftp_parselist(char *buffer, size_t size, size_t nmemb, void *connptr) return bufflen; } parser->state.NT.main = PL_WINNT_DATE; - parser->state.NT.sub.filename = 0; + parser->state.NT.sub.filename = PL_WINNT_FILENAME_PRESPACE; } else { PL_ERROR(conn, CURLE_FTP_BAD_FILE_LIST); |