]> 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)
ext/phar/phar.c

index 062655af96dbce79a133e554f5ca8ce9b2eb2701..ddd686d00edc26c11ac55f9c486c36755e24f33f 100644 (file)
@@ -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
 } /* }}} */