php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #57739 Segmentation fault with invalid references
Submitted: 2007-07-11 12:04 UTC Modified: 2007-07-15 08:29 UTC
From: skettler@php.net Assigned: indeyets (profile)
Status: Closed Package: syck (PECL)
PHP Version: 5.2.1 OS: Debian/Linux Etch
Private report: No CVE-ID: None
View Add Comment Developer Edit
Anyone can comment on a bug. Have a simpler test case? Does it work for you on a different platform? Let us know!
Just going to say 'Me too!'? Don't clutter the database with that please !
Your email address:
MUST BE VALID
Solve the problem:
49 - 34 = ?
Subscribe to this entry?

 
 [2007-07-11 12:04 UTC] skettler@php.net
Description:
------------
If a YAML file contains a pointer to a non-existing reference, the PHP interpreter crashes with segmentation fault.

I'm using the Syck library version 0.55 from http://whytheluckystiff.net/syck/.

Reproduce code:
---------------
$yaml = <<<EOS
define: &pointer_to_define
   - 1
   - 2
   - 3
reference: *pointer_to_define
EOS;

print_r(syck_load($yaml));
print "\n";

$yaml = <<<EOS
define: &pointer_to_define
   - 1
   - 2
   - 3
reference: *broken_pointer_to_define
EOS;

print_r(syck_load($yaml));
print "\n";


Expected result:
----------------
Array
(
    [define] => Array
        (
            [0] => 1
            [1] => 2
            [2] => 3
        )

    [reference] => Array
        (
            [0] => 1
            [1] => 2
            [2] => 3
        )

)

Array
(
    [define] => Array
        (
            [0] => 1
            [1] => 2
            [2] => 3
        )

    [reference] => Array
        (
            [0] => 1
            [1] => 2
            [2] => 3
        )

)



Actual result:
--------------
Array
(
    [define] => Array
        (
            [0] => 1
            [1] => 2
            [2] => 3
        )

    [reference] => Array
        (
            [0] => 1
            [1] => 2
            [2] => 3
        )

)

Segmentation fault


Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2007-07-11 12:10 UTC] indeyets at gmail dot com
confirmed.
looking at it

thanks :)
 [2007-07-15 08:29 UTC] indeyets at gmail dot com
Thank you for your bug report. This issue has been fixed
in the latest released version of the package, which you can download at
http://pecl.php.net/get/syck


 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Fri Mar 29 09:01:28 2024 UTC