php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #47721 Aligment issues in mbstring and sysvshm extensions
Submitted: 2009-03-19 17:19 UTC Modified: 2009-03-19 23:12 UTC
From: crrodriguez at opensuse dot org Assigned:
Status: Closed Package: *General Issues
PHP Version: 5.2CVS-2009-03-19 (CVS) OS: Linux ia64
Private report: No CVE-ID: None
 [2009-03-19 17:19 UTC] crrodriguez at opensuse dot org
Description:
------------
in platforms which strictly alignment is required, we still have some bugs..

patch:

--- ext/mbstring/oniguruma/regint.h
+++ ext/mbstring/oniguruma/regint.h
@@ -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 \
--- ext/sysvshm/sysvshm.c
+++ ext/sysvshm/sysvshm.c
@@ -375,7 +375,7 @@ static int php_put_shm_data(sysvshm_chun
    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);


Reproduce code:
---------------
-----

Expected result:
----------------
------

Actual result:
--------------
--------

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2009-03-19 23:12 UTC] iliaa@php.net
This bug has been fixed in CVS.

Snapshots of the sources are packaged every three hours; this change
will be in the next snapshot. You can grab the snapshot at
http://snaps.php.net/.
 
Thank you for the report, and for helping us make PHP better.


 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Tue Mar 19 03:01:29 2024 UTC