Hi Ilia,

Was the 2nd patch in the bug no longer needed?

Chris

On 11/20/10 11:27 AM, Ilia Alshanetsky wrote:
iliaa                                    Sat, 20 Nov 2010 19:27:31 +0000

Revision: http://svn.php.net/viewvc?view=revision&revision=305582

Log:
Fixed bug #50987 (unaligned memory access in phar.c)

Bug: http://bugs.php.net/50987 (Assigned) unaligned memory access in phar.c

Changed paths:
     U   php/php-src/branches/PHP_5_3/NEWS
     U   php/php-src/branches/PHP_5_3/ext/phar/phar.c
     U   php/php-src/trunk/ext/phar/phar.c

Modified: php/php-src/branches/PHP_5_3/NEWS
===================================================================
--- php/php-src/branches/PHP_5_3/NEWS   2010-11-20 16:10:04 UTC (rev 305581)
+++ php/php-src/branches/PHP_5_3/NEWS   2010-11-20 19:27:31 UTC (rev 305582)
@@ -8,6 +8,8 @@
  - Fixed crashes on invalid parameters in intl extension (Stas, Maksymilian
    Arciemowicz)
  - Fixed bug #53362 (Segmentation fault when extending SplFixedArray). (Felipe)
+- Fixed bug #50987 (unaligned memory access in phar.c).
+  (geissert at debian dot org, Ilia)
  - Fixed bug #47168 (printf of floating point variable prints maximum of 40
    decimal places). (Ilia)


Modified: php/php-src/branches/PHP_5_3/ext/phar/phar.c
===================================================================
--- php/php-src/branches/PHP_5_3/ext/phar/phar.c        2010-11-20 16:10:04 UTC 
(rev 305581)
+++ php/php-src/branches/PHP_5_3/ext/phar/phar.c        2010-11-20 19:27:31 UTC 
(rev 305582)
@@ -2491,7 +2491,7 @@
        *((buffer) + 1) = (unsigned char) (((var)>>  8)&  0xFF);
        *((buffer) + 0) = (unsigned char) ((var)&  0xFF);
  #else
-       *(php_uint32 *)(buffer) = (php_uint32)(var);
+        memcpy(buffer,&var, sizeof(var));
  #endif
  } /* }}} */


Modified: php/php-src/trunk/ext/phar/phar.c
===================================================================
--- php/php-src/trunk/ext/phar/phar.c   2010-11-20 16:10:04 UTC (rev 305581)
+++ php/php-src/trunk/ext/phar/phar.c   2010-11-20 19:27:31 UTC (rev 305582)
@@ -2489,7 +2489,7 @@
        *((buffer) + 1) = (unsigned char) (((var)>>  8)&  0xFF);
        *((buffer) + 0) = (unsigned char) ((var)&  0xFF);
  #else
-       *(php_uint32 *)(buffer) = (php_uint32)(var);
+        memcpy(buffer,&var, sizeof(var));
  #endif
  } /* }}} */




--
Email: christopher.jo...@oracle.com
Tel:  +1 650 506 8630
Blog:  http://blogs.oracle.com/opal/

--
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to