diff options
author | Daniel Stenberg <daniel@haxx.se> | 2001-10-31 15:06:38 +0000 |
---|---|---|
committer | Daniel Stenberg <daniel@haxx.se> | 2001-10-31 15:06:38 +0000 |
commit | 4118c68df18b505483e073b56c8450ad1642f691 (patch) | |
tree | 9b55778c6a89b08c5f55ac02baaa25e6ed2da53b /lib | |
parent | 69d5d88259e1542ac2a9da8f17e67c59602159cf (diff) |
check Curl_ftpsendf return codes
Diffstat (limited to 'lib')
-rw-r--r-- | lib/krb4.c | 10 | ||||
-rw-r--r-- | lib/security.c | 11 |
2 files changed, 14 insertions, 7 deletions
diff --git a/lib/krb4.c b/lib/krb4.c index fd7934e52..96cc4520d 100644 --- a/lib/krb4.c +++ b/lib/krb4.c @@ -245,7 +245,8 @@ krb4_auth(void *app_data, struct connectdata *conn) return AUTH_CONTINUE; } - Curl_ftpsendf(conn, "ADAT %s", p); + if(Curl_ftpsendf(conn, "ADAT %s", p)) + return -2; nread = Curl_GetFTPResponse(conn->data->state.buffer, conn, NULL); if(nread < 0) @@ -312,7 +313,8 @@ void Curl_krb_kauth(struct connectdata *conn) save = Curl_set_command_prot(conn, prot_private); - Curl_ftpsendf(conn, "SITE KAUTH %s", conn->data->state.user); + if(Curl_ftpsendf(conn, "SITE KAUTH %s", conn->data->state.user)) + return; nread = Curl_GetFTPResponse(conn->data->state.buffer, conn, NULL); @@ -378,8 +380,8 @@ void Curl_krb_kauth(struct connectdata *conn) } memset (tktcopy.dat, 0, tktcopy.length); - Curl_ftpsendf(conn, - "SITE KAUTH %s %s", name, p); + if(Curl_ftpsendf(conn, "SITE KAUTH %s %s", name, p)) + return; nread = Curl_GetFTPResponse(conn->data->state.buffer, conn, NULL); diff --git a/lib/security.c b/lib/security.c index c39f2a0b6..2a92d0bc9 100644 --- a/lib/security.c +++ b/lib/security.c @@ -413,7 +413,9 @@ sec_prot_internal(struct connectdata *conn, int level) } if(level){ - Curl_ftpsendf(conn, "PBSZ %u", s); + if(Curl_ftpsendf(conn, "PBSZ %u", s)) + return -1; + nread = Curl_GetFTPResponse(conn->data->state.buffer, conn, NULL); if(nread < 0) return -1; @@ -431,7 +433,9 @@ sec_prot_internal(struct connectdata *conn, int level) conn->buffer_size = s; } - Curl_ftpsendf(conn, "PROT %c", level["CSEP"]); + if(Curl_ftpsendf(conn, "PROT %c", level["CSEP"])) + return -1; + nread = Curl_GetFTPResponse(conn->data->state.buffer, conn, NULL); if(nread < 0) return -1; @@ -488,7 +492,8 @@ Curl_sec_login(struct connectdata *conn) } infof(data, "Trying %s...\n", (*m)->name); - Curl_ftpsendf(conn, "AUTH %s", (*m)->name); + if(Curl_ftpsendf(conn, "AUTH %s", (*m)->name)) + return -1; nread = Curl_GetFTPResponse(conn->data->state.buffer, conn, &ftpcode); if(nread < 0) |