sabre-io / xml

sabre/xml is an XML library that you may not hate.
http://sabre.io/xml/
BSD 3-Clause "New" or "Revised" License
516 stars 77 forks source link

Prevent infinite loops for empty props element #132

Closed rullzer closed 6 years ago

rullzer commented 7 years ago

If you do a propfind with:

<?xml version="1.0"?>
<a:propfind xmlns:a="DAV:">
  <a:prop></a:prop>
</a:propfind>

And have this parsed:

use Sabre\DAV\Xml\Service;

$content = '<?xml version="1.0"?><a:propfind xmlns:a="DAV:"><a:prop></a:prop></a:propfind>';

$xml = new Service();
$xml->expect('{DAV:}propfind', $content);

Then this results in an infinite loop. This patch breaks out of the loop once the reader fails to read.

LorbusChris commented 6 years ago

@rullzer any progress on this?

rullzer commented 6 years ago

It is still dangling somewhere on my todo... But that todo is long