kalle                                    Sat, 20 Nov 2010 20:59:28 +0000

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

Log:
Added second fix from #50987 that wasn't apart of Ilia's commit

Bug: http://bugs.php.net/50987 (Closed) unaligned memory access in phar.c
      
Changed paths:
    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/ext/phar/phar.c
===================================================================
--- php/php-src/branches/PHP_5_3/ext/phar/phar.c        2010-11-20 20:36:36 UTC 
(rev 305583)
+++ php/php-src/branches/PHP_5_3/ext/phar/phar.c        2010-11-20 20:59:28 UTC 
(rev 305584)
@@ -512,7 +512,7 @@
        (buffer) += 2
 #else
 # define PHAR_GET_32(buffer, var) \
-       var = *(php_uint32*)(buffer); \
+       memcpy(&var, buffer, sizeof(var)); \
        buffer += 4
 # define PHAR_GET_16(buffer, var) \
        var = *(php_uint16*)(buffer); \

Modified: php/php-src/trunk/ext/phar/phar.c
===================================================================
--- php/php-src/trunk/ext/phar/phar.c   2010-11-20 20:36:36 UTC (rev 305583)
+++ php/php-src/trunk/ext/phar/phar.c   2010-11-20 20:59:28 UTC (rev 305584)
@@ -512,7 +512,7 @@
        (buffer) += 2
 #else
 # define PHAR_GET_32(buffer, var) \
-       var = *(php_uint32*)(buffer); \
+       memcpy(&var, buffer, sizeof(var)); \
        buffer += 4
 # define PHAR_GET_16(buffer, var) \
        var = *(php_uint16*)(buffer); \

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

Reply via email to