diff options
author | Curl Upstream <curl-library@cool.haxx.se> | 2016-11-02 06:34:06 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2016-12-05 16:39:32 (GMT) |
commit | 93cc249f3dd7ecd621cd063e4c08bbdb54d971e8 (patch) | |
tree | 4cd65530c3a67921921256010ae5ef0a61596e40 /lib/security.c | |
parent | 202adcfe056681109fe61569ecdb3bd69f0b4f97 (diff) | |
download | CMake-93cc249f3dd7ecd621cd063e4c08bbdb54d971e8.zip CMake-93cc249f3dd7ecd621cd063e4c08bbdb54d971e8.tar.gz CMake-93cc249f3dd7ecd621cd063e4c08bbdb54d971e8.tar.bz2 |
curl 2016-11-02 (3c561c65)
Code extracted from:
https://github.com/curl/curl.git
at commit 3c561c657c2f0e553b19115a506592a8bbd744bc (curl-7_51_0).
Diffstat (limited to 'lib/security.c')
-rw-r--r-- | lib/security.c | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/lib/security.c b/lib/security.c index a0bcaea..ff26066 100644 --- a/lib/security.c +++ b/lib/security.c @@ -60,7 +60,7 @@ #include "curl_sec.h" #include "ftp.h" #include "sendf.h" -#include "rawstr.h" +#include "strcase.h" #include "warnless.h" /* The last #include file should be: */ @@ -122,7 +122,7 @@ static int ftp_send_command(struct connectdata *conn, const char *message, ...) vsnprintf(print_buffer, sizeof(print_buffer), message, args); va_end(args); - if(Curl_ftpsendf(conn, print_buffer)) { + if(Curl_ftpsend(conn, print_buffer)) { ftp_code = -1; } else { @@ -192,15 +192,18 @@ static CURLcode read_data(struct connectdata *conn, struct krb5buffer *buf) { int len; - void* tmp; + void *tmp = NULL; CURLcode result; result = socket_read(fd, &len, sizeof(len)); if(result) return result; - len = ntohl(len); - tmp = realloc(buf->data, len); + if(len) { + /* only realloc if there was a length */ + len = ntohl(len); + tmp = realloc(buf->data, len); + } if(tmp == NULL) return CURLE_OUT_OF_MEMORY; |