Changeset 298 for trunk

Show
Ignore:
Timestamp:
03/17/2008 07:57:55 (8 months ago)
Author:
indeyets
Message:

fixed bug#31 (broken yaml caused segfault)

Location:
trunk/ext/php
Files:
1 added
4 modified

Legend:

Unmodified
Added
Removed
  • trunk/ext/php

    • Property svn:ignore set to
      .deps
      .gdb_history
      .libs
      Makefile
      Makefile.fragments
      Makefile.global
      Makefile.objects
      acinclude.m4
      aclocal.m4
      autom4te.cache
      build
      config.guess
      config.h
      config.h.in
      config.log
      config.nice
      config.status
      config.sub
      configure
      configure.in
      include
      install-sh
      libtool
      ltmain.sh
      missing
      mkinstalldirs
      modules
      run-tests.php
  • trunk/ext/php/CHANGELOG

    r294 r298  
    11--- %YAML:1.0 
     2- version: 0.9.3 
     3  date: 2008-??-?? 
     4  status: beta 
     5  changes: 
     6    - fixed bug#31 (broken yaml caused segfault) 
     7 
    28- version: 0.9.2 
    39  date: 2007-11-22 
  • trunk/ext/php/phpext.c

    r297 r298  
    3737#endif 
    3838 
    39 #define PHP_SYCK_VERSION "0.9.2" 
     39#define PHP_SYCK_VERSION "0.9.3-dev" 
    4040 
    4141/** 
     
    509509                                } 
    510510                        } else if (strncmp(n->type_id, "php/hash::", 10) == 0) { 
    511                                 /* some classm which implements ArrayAccess */ 
     511                                /* some class which implements ArrayAccess */ 
    512512                                SYMID oid; 
    513513                                size_t i; 
     
    594594{ 
    595595        char *endl = p->cursor; 
     596        zval *exc; 
    596597        TSRMLS_FETCH(); 
    597598 
     
    601602        endl[0] = '\0'; 
    602603 
    603         zend_throw_exception_ex(syck_exception_entry, 0 TSRMLS_CC, "%s on line %d, col %d: '%s'", str, p->linect, p->cursor - p->lineptr, p->lineptr); 
     604        exc = zend_throw_exception_ex(syck_exception_entry, 0 TSRMLS_CC, "%s on line %d, col %d: '%s'", str, p->linect, p->cursor - p->lineptr, p->lineptr); 
     605        exc->refcount = 2; // hack 
    604606 
    605607        st_foreach(p->syms, my_cleaner, NULL); 
     
    832834        } 
    833835 
    834  
    835836        syck_free_parser(parser); 
    836837} 
  • trunk/ext/php/phpunit-tests/TestLoad.php

    r285 r298  
    208208        $this->assertSame('teststring', $obj->test()); 
    209209    } 
     210 
     211    public function testBug31() 
     212    { 
     213        try { 
     214            $obj = syck_load(file_get_contents(dirname(__FILE__).'/bug31.yaml')); 
     215            $this->assertTrue(false); 
     216        } catch (SyckException $e) { 
     217            $this->assertTrue(true); 
     218        } 
     219    } 
    210220}