-
-
Notifications
You must be signed in to change notification settings - Fork 9.6k
[Validator] prevent hash collisions caused by reused object hashes #38387
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
Conversation
xabbuh
commented
Oct 2, 2020
Q | A |
---|---|
Branch? | 3.4 |
Bug fix? | yes |
New feature? | no |
Deprecations? | no |
Tickets | Fix #36415 |
License | MIT |
Doc PR |
ping @fancyweb |
return spl_object_hash($object); | ||
} | ||
|
||
private function cleanUpObjectRefs() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
shouldn't calls to this cleanUpObjectRefs
happen in a finally
block instead, to be sure we also record the end of the callstack when some called code triggers an exception ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In fact keeping the object references in the validator instance does not work as expected as new validator instances can be created in one validation run. I decided to move the reference handling to the execution context instead which also saves us from worrying about have to clean up the stored references instead.
907ddf6
to
752d2a4
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As discussed on Slack, we would need a test that assert that using the same constraint instance on several paths on the same RecursiveContextualValidator
instance (by using atPath()
) works correctly.
15b77b1
to
85f359c
Compare
85f359c
to
9c81f2a
Compare
89c48ea
to
099886f
Compare
099886f
to
8dd1a6e
Compare
Thank you @fancyweb. |