~clint-fewbar/ubuntu/precise/php5/php5-5.4-merge

« back to all changes in this revision

Viewing changes to debian/patches/unaligned_memory_access.patch

  • Committer: Package Import Robot
  • Author(s): Chuck Short
  • Date: 2011-02-22 09:46:37 UTC
  • mfrom: (1.1.20) (0.3.18 sid)
  • Revision ID: package-import@ubuntu.com-20110222094637-nlu2tvb7oqgaarl0
Tags: 5.3.5-1ubuntu1
* Merge from debian/unstable. Remaining changes:
 - debian/control:
    * Dropped firebird2.1-dev, libc-client-dev, libmcrypt-dev as it is in universe.
    * Dropped libmysqlclient15-dev, build against mysql 5.1.
    * Dropped libcurl-dev not in the archive.
    * Suggest php5-suhosin rather than recommends.
    * Dropped php5-imap, php5-interbase, php5-mcrypt since we have versions 
      already in universe.
    * Dropped libonig-dev and libqgdbm since its in universe. (will be re-added in lucid+1)
    * Dropped locales-all.
  - modulelist: Drop imap, interbase, sybase, and mcrypt.
  - debian/rules:
    * Dropped building of mcrypt, imap, and interbase.
    * Install apport hook for php5.
    * stop mysql instance on clean just in case we failed in tests

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
Description: Fix unaligned memory access.
2
 
Origin: vendor
3
 
Forwarded: http://bugs.php.net/50987
4
 
Last-Update: 2010-02-09
5
 
 
6
 
Index: php/ext/phar/phar.c
7
 
===================================================================
8
 
--- php.orig/ext/phar/phar.c
9
 
+++ php/ext/phar/phar.c
10
 
@@ -512,7 +512,7 @@ void phar_entry_remove(phar_entry_data *
11
 
        (buffer) += 2
12
 
 #else
13
 
 # define PHAR_GET_32(buffer, var) \
14
 
-       var = *(php_uint32*)(buffer); \
15
 
+       memcpy(&var, buffer, sizeof(var)); \
16
 
        buffer += 4
17
 
 # define PHAR_GET_16(buffer, var) \
18
 
        var = *(php_uint16*)(buffer); \
19
 
@@ -2491,7 +2491,7 @@ static inline void phar_set_32(char *buf
20
 
        *((buffer) + 1) = (unsigned char) (((var) >> 8) & 0xFF);
21
 
        *((buffer) + 0) = (unsigned char) ((var) & 0xFF);
22
 
 #else
23
 
-       *(php_uint32 *)(buffer) = (php_uint32)(var);
24
 
+       memcpy(buffer, &var, sizeof(var));
25
 
 #endif
26
 
 } /* }}} */
27