From: Ilia Alshanetsky Date: Sat, 20 Nov 2010 19:27:31 +0000 (+0000) Subject: Fixed bug #50987 (unaligned memory access in phar.c) X-Git-Tag: php-5.3.4RC2~40 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=5f1b91a6bfeb349e1113c66885c6d49a47fe76e8;p=php Fixed bug #50987 (unaligned memory access in phar.c) --- diff --git a/NEWS b/NEWS index 8cf9294882..20dc231c81 100644 --- 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) diff --git a/ext/phar/phar.c b/ext/phar/phar.c index f255537fa7..7ae346d793 100644 --- a/ext/phar/phar.c +++ b/ext/phar/phar.c @@ -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 } /* }}} */