Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Prevent infinite loops for empty props element #132

Closed
wants to merge 2 commits into from

Conversation

rullzer
Copy link

@rullzer rullzer commented Aug 17, 2017

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.

Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
@DeepDiver1975 DeepDiver1975 self-requested a review October 9, 2017 21:27
Copy link
Member

@DeepDiver1975 DeepDiver1975 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please add a unit test - THX

@LorbusChris
Copy link

@rullzer any progress on this?

@rullzer
Copy link
Author

rullzer commented Feb 8, 2018

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants