diff options
author | Brad King <brad.king@kitware.com> | 2016-12-05 16:50:43 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2016-12-05 16:50:43 (GMT) |
commit | f8a1ba202f51e70510f12f46fe0633ea908d5144 (patch) | |
tree | fe7f931cdb5c0049cd97660e3888a816dfd4a86f /Utilities/cmcurl/lib/security.c | |
parent | 25d7b1ca9d3a160850ad1f147ff96ac7c55f7d9f (diff) | |
parent | 93cc249f3dd7ecd621cd063e4c08bbdb54d971e8 (diff) | |
download | CMake-f8a1ba202f51e70510f12f46fe0633ea908d5144.zip CMake-f8a1ba202f51e70510f12f46fe0633ea908d5144.tar.gz CMake-f8a1ba202f51e70510f12f46fe0633ea908d5144.tar.bz2 |
Merge branch 'upstream-curl' into update-curl
* upstream-curl:
curl 2016-11-02 (3c561c65)
Diffstat (limited to 'Utilities/cmcurl/lib/security.c')
-rw-r--r-- | Utilities/cmcurl/lib/security.c | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/Utilities/cmcurl/lib/security.c b/Utilities/cmcurl/lib/security.c index a0bcaea..ff26066 100644 --- a/Utilities/cmcurl/lib/security.c +++ b/Utilities/cmcurl/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; |