]> granicus.if.org Git - php/commitdiff
Fixed bug #47721 (Aligment issues in mbstring and sysvshm extension)
authorIlia Alshanetsky <iliaa@php.net>
Thu, 19 Mar 2009 23:10:44 +0000 (23:10 +0000)
committerIlia Alshanetsky <iliaa@php.net>
Thu, 19 Mar 2009 23:10:44 +0000 (23:10 +0000)
NEWS
ext/mbstring/oniguruma/regint.h
ext/sysvshm/sysvshm.c

diff --git a/NEWS b/NEWS
index c26edbb701d496464860d75b7467a123b91f3f43..9c94ad5d93118bc17fe4501a355b71b3fef8c4ca 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -6,6 +6,8 @@ PHP                                                                        NEWS
 
 - Fixed memory corruptions while reading properties of zip files. (Ilia)
 
+- Fixed bug #47721 (Aligment issues in mbstring and sysvshm extension)
+  (crrodriguez at opensuse dot org, Ilia)
 - Fixed bug #47704 (PHP crashes on some "bad" operations with string offsets).
   (Dmitry)
 - Fixed bug #47667 (ZipArchive::OVERWRITE seems to have no effect). (Mikko, Pierre)
index cd238bb518da25b6afb4eefafd6a7ef24647d3ec..ba84fab6a17ae3e647513a2de776e1ebad76e384 100644 (file)
 #define NULL_UCHARP                   ((UChar* )0)
 
 #ifndef PLATFORM_UNALIGNED_WORD_ACCESS
-#define WORD_ALIGNMENT_SIZE       SIZEOF_INT
+#define WORD_ALIGNMENT_SIZE       SIZEOF_LONG
 
 #define GET_ALIGNMENT_PAD_SIZE(addr,pad_size) do {\
   (pad_size) = WORD_ALIGNMENT_SIZE \
index cebe5d724ca8d6cb3ffb1e47bbc17838dc20b381..a93fd4c94861c26c930f056ca19e22707f99a523 100644 (file)
@@ -375,7 +375,7 @@ static int php_put_shm_data(sysvshm_chunk_head *ptr, long key, char *data, long
        long total_size;
        long shm_varpos;
 
-       total_size = ((long) (len + sizeof(sysvshm_chunk) - 1) / 4) * 4 + 4; /* 4-byte alligment */
+       total_size = ((long) (len + sizeof(sysvshm_chunk) - 1) / sizeof(long)) * sizeof(long) + sizeof(long); /* long alligment */
 
        if ((shm_varpos = php_check_shm_data(ptr, key)) > 0) {
                php_remove_shm_data(ptr, shm_varpos);