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

index 96f9e45b77a5dc5f4e0a79b8bc1679a824673f01..11f3c43af94b66a6727924fd15c954b9dc11b380 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 aadc10055a232def7c26f15231c2520e264ece08..9f62086e3a3ab924a830dfcd02b5cafd438036a2 100644 (file)
@@ -357,7 +357,7 @@ static int php_put_shm_data(sysvshm_chunk_head *ptr, long key, const char *data,
        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);