]> granicus.if.org Git - php/commitdiff
Fixed bug #50987 (unaligned memory access in phar.c)
authorIlia Alshanetsky <iliaa@php.net>
Sat, 20 Nov 2010 19:27:31 +0000 (19:27 +0000)
committerIlia Alshanetsky <iliaa@php.net>
Sat, 20 Nov 2010 19:27:31 +0000 (19:27 +0000)
NEWS
ext/phar/phar.c

diff --git a/NEWS b/NEWS
index 8cf92948823accacfbb2dd555be7796009693714..20dc231c8121bed3293bfcfe98fd3e4f69353693 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -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)
 
index f255537fa735d3cba1c22bd503907eee2e16921f..7ae346d7933f4a5590359704a6c520ba4d5af57f 100644 (file)
@@ -2491,7 +2491,7 @@ static inline void phar_set_32(char *buffer, int var) /* {{{ */
        *((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
 } /* }}} */