~ubuntu-branches/ubuntu/natty/php5/natty

« back to all changes in this revision

Viewing changes to debian/patches/fix-segfault-when-extending-SplFixedArray.patch

  • Committer: Package Import Robot
  • Author(s): Chuck Short
  • Date: 2011-01-07 22:44:56 UTC
  • mfrom: (0.3.17 sid)
  • Revision ID: package-import@ubuntu.com-20110107224456-rfnz8n46skjgr7nm
Tags: 5.3.3-7ubuntu1
* 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
  - Dropped debian/patches/fix-upstream-bug53632.patch, used debian's instead.
  - Dropped debian/patches/mssql-fix-segfault.patch, use debian's instead.
  - debian/patches/configure-as-needed.patch. Work around suspicious
    configure macros to fix a build failure with --as-needed
  - debian/patches/php52389-pgsql-segfault.patch: removing, causes error
    handling to fail.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
--- /dev/null
 
2
+++ b/ext/spl/tests/bug53362.phpt
 
3
@@ -0,0 +1,22 @@
 
4
+--TEST--
 
5
+Bug #53362 (Segmentation fault when extending SplFixedArray)
 
6
+--FILE--
 
7
+<?php
 
8
+
 
9
+class obj extends SplFixedArray{
 
10
+       public function offsetSet($offset, $value) {
 
11
+               var_dump($offset);
 
12
+       }
 
13
+}
 
14
+
 
15
+$obj = new obj;
 
16
+
 
17
+$obj[]=2;
 
18
+$obj[]=2;
 
19
+$obj[]=2;
 
20
+
 
21
+?>
 
22
+--EXPECTF--
 
23
+NULL
 
24
+NULL
 
25
+NULL
 
26
--- a/ext/spl/spl_fixedarray.c
 
27
+++ b/ext/spl/spl_fixedarray.c
 
28
@@ -409,7 +409,11 @@ static void spl_fixedarray_object_write_
 
29
        intern = (spl_fixedarray_object *)zend_object_store_get_object(object TSRMLS_CC);
 
30
 
 
31
        if (intern->fptr_offset_set) {
 
32
-               SEPARATE_ARG_IF_REF(offset);
 
33
+               if (!offset) {
 
34
+                       ALLOC_INIT_ZVAL(offset);
 
35
+               } else {
 
36
+                       SEPARATE_ARG_IF_REF(offset);
 
37
+               }
 
38
                SEPARATE_ARG_IF_REF(value);
 
39
                zend_call_method_with_2_params(&object, intern->std.ce, &intern->fptr_offset_set, "offsetSet", NULL, offset, value);
 
40
                zval_ptr_dtor(&value);