diff options
author | Dan Fandrich <dan@coneharvesters.com> | 2009-08-11 02:30:53 +0000 |
---|---|---|
committer | Dan Fandrich <dan@coneharvesters.com> | 2009-08-11 02:30:53 +0000 |
commit | 0dec3e5e6a3d9f2279b58afae133a0910badcfa3 (patch) | |
tree | 3a3b7e6c1dbde82cc22f888916f34c92baf9bd41 /lib | |
parent | 66f5baa16e83c0e629d19e47da21de15aa65b77d (diff) |
Fixed a memory leak in the FTP code and an off-by-one heap buffer overflow.
Diffstat (limited to 'lib')
-rw-r--r-- | lib/ftp.c | 6 |
1 files changed, 3 insertions, 3 deletions
@@ -926,9 +926,9 @@ static CURLcode ftp_state_use_port(struct connectdata *conn, char *port_start = NULL; char *port_sep = NULL; - addr = malloc(addrlen); - memset(addr, 0, addrlen); - + addr = calloc(addrlen+1, 1); + if (!addr) + return CURLE_OUT_OF_MEMORY; #ifdef ENABLE_IPV6 if(*string_ftpport == '[') { |