]> granicus.if.org Git - php/commitdiff
MFH: long is not always 32-bit
authorSara Golemon <pollita@php.net>
Fri, 20 Feb 2004 21:09:08 +0000 (21:09 +0000)
committerSara Golemon <pollita@php.net>
Fri, 20 Feb 2004 21:09:08 +0000 (21:09 +0000)
NEWS
ext/ftp/ftp.c

diff --git a/NEWS b/NEWS
index c97980486077f519b65b2872b288a5fabd3894d4..3d87a5c6353a051ed983b94606030245f61fe73f 100644 (file)
--- 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
index 2bb92ad5ce4fc5ad249d319429cbd57483d1945d..682688a9ff891c4df65472b1ca08bb37ef295056 100644 (file)
@@ -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],