From: Sara Golemon Date: Fri, 20 Feb 2004 21:09:08 +0000 (+0000) Subject: MFH: long is not always 32-bit X-Git-Tag: php-4.3.5RC4~77 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=2a0e69c111daf0eeb80084435949309229f9a7f1;p=php MFH: long is not always 32-bit --- diff --git a/NEWS b/NEWS index c979804860..3d87a5c635 100644 --- a/NEWS +++ b/NEWS @@ -1,6 +1,7 @@ PHP 4 NEWS ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||| ?? Feb 2004, Version 4.3.5 +- Fixed bug #27328 (ftp extension relies on 32-bit longs). (Sara) - Fixed bug #27295 (memory leak inside sscanf()). (Ilia) - Fixed bug #27293 (two crashes inside image2wbmp()). (Ilia) - Fixed bug #27278 (*printf() functions treat arguments as if passed by diff --git a/ext/ftp/ftp.c b/ext/ftp/ftp.c index 2bb92ad5ce..682688a9ff 100644 --- a/ext/ftp/ftp.c +++ b/ext/ftp/ftp.c @@ -638,7 +638,7 @@ ftp_pasv(ftpbuf_t *ftp, int pasv) sin = (struct sockaddr_in *) sa; sin->sin_family = AF_INET; - sin->sin_addr.s_addr = ipbox.l[0]; + memcpy(&(sin->sin_addr.s_addr), &(ipbox.c[0]), 4); sin->sin_port = ipbox.s[2]; ftp->pasv = 2; @@ -1328,7 +1328,7 @@ ftp_getdata(ftpbuf_t *ftp TSRMLS_DC) #endif /* send the PORT */ - ipbox.l[0] = ((struct sockaddr_in*) sa)->sin_addr.s_addr; + memcpy(&(ipbox.c[0]), &(((struct sockaddr_in*) sa)->sin_addr.s_addr), 4); ipbox.s[2] = ((struct sockaddr_in*) &addr)->sin_port; sprintf(arg, "%u,%u,%u,%u,%u,%u", ipbox.c[0], ipbox.c[1], ipbox.c[2], ipbox.c[3],