Commit 17a8bf21 authored by Daniel Stenberg's avatar Daniel Stenberg
Browse files

The buffer in ftp_pasv_verbose(), used for gethostbyaddr_r(), is now defined

to become properly 8-byte aligned on 64-bit archs. Philip Gladstone reported.
parent 4fc76afe
Loading
Loading
Loading
Loading
+5 −1
Original line number Original line Diff line number Diff line
@@ -861,13 +861,17 @@ ftp_pasv_verbose(struct connectdata *conn,
#ifdef HAVE_INET_NTOA_R
#ifdef HAVE_INET_NTOA_R
  char ntoa_buf[64];
  char ntoa_buf[64];
#endif
#endif
  char hostent_buf[9000];
  /* The array size trick below is to make this a large chunk of memory
     suitably 8-byte aligned on 64-bit platforms. This was thoughtfully
     suggested by Philip Gladstone. */
  long bigbuf[9000 / sizeof(long)];


#if defined(HAVE_INET_ADDR)
#if defined(HAVE_INET_ADDR)
  in_addr_t address;
  in_addr_t address;
# if defined(HAVE_GETHOSTBYADDR_R)
# if defined(HAVE_GETHOSTBYADDR_R)
  int h_errnop;
  int h_errnop;
# endif
# endif
  char *hostent_buf = (char *)bigbuf; /* get a char * to the buffer */


  address = inet_addr(newhost);
  address = inet_addr(newhost);
# ifdef HAVE_GETHOSTBYADDR_R
# ifdef HAVE_GETHOSTBYADDR_R