|   | php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login | 
| 
  [2016-07-04 03:40 UTC] fernando at null-life dot com
 Description:
------------
yaml_parse_url fails with an abort when the passed stream/file is empty, maybe an exception/error should be returned here.
Test script:
---------------
<?php
touch("x");
$v1="x"; $v2=3;
yaml_parse_url($v1, $v2);
Expected result:
----------------
no crash
Actual result:
--------------
crash
pwneable:matatetete fmunozs$ php x.php 
Assertion failed: (input), function yaml_parser_set_input_string, file api.c, line 288.
Abort trap: 6
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits             | |||||||||||||||||||||||||||||||||
|  Copyright © 2001-2025 The PHP Group All rights reserved. | Last updated: Fri Oct 31 11:00:01 2025 UTC | 
Affects both 2.0.0 (PHP7) and 1.3.0 (PHP5). PHP5 crash output is: php: api.c:288: yaml_parser_set_input_string: Assertion `input' failed. Aborted (core dumped) yaml_parser_set_input_string is a function from libyaml. That upstream function includes an assert() for non-null input. The extension needs to check for this degenerate case and handle it more gracefully. It would be in keeping with the rest of the API to emit a warning and return null.