Moriyoshi,
The change relates to alignment issues on platforms that are strict in
that regard. If you use instead of longs, you could end up with
crashes where sizeof(int) != sizeof(long)
Ilia Alshanetsky
On 24-Mar-09, at 10:05 PM, Moriyoshi Koizumi wrote:
Hey, we need to be more specific on what was the problem and what this
patch actually fixes; oniguruma is a third-party library and I really
don't think we'll be good at keeping up to upstream-updates with such
a site specific change.
Moriyoshi
2009/3/20 Ilia Alshanetsky :
iliaa Thu Mar 19 23:10:45 2009 UTC
Modified files: (Branch: PHP_5_2)
/php-src/ext/mbstring/oniguruma regint.h
/php-src/ext/sysvshmsysvshm.c
/php-srcNEWS
Log:
Fixed bug #47721 (Aligment issues in mbstring and sysvshm extension)
http://cvs.php.net/viewvc.cgi/php-src/ext/mbstring/oniguruma/regint.h?r1=1.5.4.7&r2=1.5.4.8&diff_format=u
Index: php-src/ext/mbstring/oniguruma/regint.h
diff -u php-src/ext/mbstring/oniguruma/regint.h:1.5.4.7 php-src/ext/
mbstring/oniguruma/regint.h:1.5.4.8
--- php-src/ext/mbstring/oniguruma/regint.h:1.5.4.7 Wed Dec 31
11:17:39 2008
+++ php-src/ext/mbstring/oniguruma/regint.h Thu Mar 19 23:10:44
2009
@@ -256,7 +256,7 @@
#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 \
http://cvs.php.net/viewvc.cgi/php-src/ext/sysvshm/sysvshm.c?r1=1.70.2.2.2.7&r2=1.70.2.2.2.8&diff_format=u
Index: php-src/ext/sysvshm/sysvshm.c
diff -u php-src/ext/sysvshm/sysvshm.c:1.70.2.2.2.7 php-src/ext/
sysvshm/sysvshm.c:1.70.2.2.2.8
--- php-src/ext/sysvshm/sysvshm.c:1.70.2.2.2.7 Wed Dec 31 11:17:46
2008
+++ php-src/ext/sysvshm/sysvshm.c Thu Mar 19 23:10:44 2009
@@ -16,7 +16,7 @@
+
--+
*/
-/* $Id: sysvshm.c,v 1.70.2.2.2.7 2008/12/31 11:17:46 sebastian Exp
$ */
+/* $Id: sysvshm.c,v 1.70.2.2.2.8 2009/03/19 23:10:44 iliaa Exp $ */
/* This has been built and tested on Linux 2.2.14
*
@@ -375,7 +375,7 @@
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);
http://cvs.php.net/viewvc.cgi/php-src/NEWS?r1=1.2027.2.547.2.1445&r2=1.2027.2.547.2.1446&diff_format=u
Index: php-src/NEWS
diff -u php-src/NEWS:1.2027.2.547.2.1445 php-src/NEWS:1.2027.2.547.2.1446
--- php-src/NEWS:1.2027.2.547.2.1445Thu Mar 19 17:56:01 2009
+++ php-src/NEWSThu Mar 19 23:10:44 2009
@@ -6,6 +6,8 @@
- 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)
--
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
--
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
--
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php