verbose PASV transfers passed a bad buffer size to the name resolver functions
authorDaniel Stenberg <daniel@haxx.se>
Sat, 16 Mar 2002 16:59:47 +0000 (16:59 +0000)
committerDaniel Stenberg <daniel@haxx.se>
Sat, 16 Mar 2002 16:59:47 +0000 (16:59 +0000)
and it cause cause a crash.

Albert Choy found and fixed it.

lib/ftp.c

index 7b269ef5a190fe1cfd85e34120afc59017a90617..4ca49a6a0dd0a0dd655dd419ee150a0565c834cd 100644 (file)
--- a/lib/ftp.c
+++ b/lib/ftp.c
@@ -914,7 +914,7 @@ ftp_pasv_verbose(struct connectdata *conn,
   answer = gethostbyaddr_r((char *) &address, sizeof(address), AF_INET,
                            (struct hostent *)bigbuf,
                            hostent_buf + sizeof(*answer),
-                           sizeof(hostent_buf) - sizeof(*answer),
+                           sizeof(bigbuf) - sizeof(*answer),
                            &h_errnop);
 #  endif
 #  ifdef HAVE_GETHOSTBYADDR_R_8
@@ -922,7 +922,7 @@ ftp_pasv_verbose(struct connectdata *conn,
   if(gethostbyaddr_r((char *) &address, sizeof(address), AF_INET,
                      (struct hostent *)hostent_buf,
                      hostent_buf + sizeof(*answer),
-                     sizeof(hostent_buf) - sizeof(*answer),
+                     sizeof(bigbuf) - sizeof(*answer),
                      &answer,
                      &h_errnop))
     answer=NULL; /* error */