[Pkg-php-commits] [php/debian-sid] Fix an unaligned memory access in the phar extension

Raphael Geissert geissert at debian.org
Wed Feb 10 07:36:21 UTC 2010


---
 debian/patches/series                        |    1 +
 debian/patches/unaligned_memory_access.patch |   18 ++++++++++++++++++
 2 files changed, 19 insertions(+), 0 deletions(-)
 create mode 100644 debian/patches/unaligned_memory_access.patch

diff --git a/debian/patches/series b/debian/patches/series
index 24e0bbe..ecb9ed9 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -38,3 +38,4 @@ sybase-alias.patch
 strcmp_null-OnUpdateErrorLog.patch
 #deprecate_short_open_tag
 ref-converted-to-value-in-_call.patch
+unaligned_memory_access.patch
diff --git a/debian/patches/unaligned_memory_access.patch b/debian/patches/unaligned_memory_access.patch
new file mode 100644
index 0000000..cefc597
--- /dev/null
+++ b/debian/patches/unaligned_memory_access.patch
@@ -0,0 +1,18 @@
+Description: Fix unaligned memory access.
+Origin: vendor
+Forwarded: http://bugs.php.net/50987
+Last-Update: 2010-02-09
+
+Index: php/ext/phar/phar.c
+===================================================================
+--- php.orig/ext/phar/phar.c
++++ php/ext/phar/phar.c
+@@ -2491,7 +2491,7 @@ static inline void phar_set_32(char *buf
+ 	*((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
+ } /* }}} */
+ 
-- 
1.6.3.3




More information about the Pkg-php-commits mailing list