jhthorsen / json-validator

:cop: Validate data against a JSON schema
https://metacpan.org/release/JSON-Validator
57 stars 59 forks source link

Fix for infinite recursion #40

Closed mrenvoize closed 7 years ago

mrenvoize commented 7 years ago

I found that if you had two ref's pointing to the same location from the same level in the json structure then you could end up in an infinite recursion.

I couldn't work out how to create a test for this :(, perl doesn't detect the recursion inside this while loop, but you can see it in a console if you put the right print statements in.

This pull request just adds what I believe to be the fix, I'd appreciate your expertise in helping write a test for this.

mrenvoize commented 7 years ago

Grr, let me get to the bottom of those failing tests first! :(

jhthorsen commented 7 years ago

You need to submit a failing test as well.