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.4.0alpha1~191^2~624 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=3016ad46ae5a8af956609d873a49681b11967742;p=php Fixed bug #50987 (unaligned memory access in phar.c) --- diff --git a/ext/phar/phar.c b/ext/phar/phar.c index 062655af96..ddd686d00e 100644 --- a/ext/phar/phar.c +++ b/ext/phar/phar.c @@ -2489,7 +2489,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 } /* }}} */