-
Notifications
You must be signed in to change notification settings - Fork 315
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
[py-tx] Validate hash length #1618
Conversation
For test plan, can you confirm if you were able to generate a successful reproduction by adding an invalid length hash in the PDQ samples? |
@Dcallies not yet, I'm trying to get a unit test going, but I'll do a manual test too |
seems like some tests do catch this 😂 will dig into them later today |
logging.warning( | ||
"Invalid fingerprint (%s): %s", | ||
s_type.get_name(), | ||
signal_str, |
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.
blocking: This string could be quite long, suggest truncating it and doing a "..."
@Dcallies I commented out the bad entry here because a few tests depended on it ( |
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.
Hmm, would like to have a regression test that would exercise this condition, but you've been at it for a while, let's merge this one.
Summary
fixes #1609
validates hash length in SignalExchangeAPIWithSimpleUpdates (used by stopNCII, file, etc)
Test Plan
reproduce error by adding
"00000000000000000000000000000000"
to the list of example PDQ hashes and try to runtx fetch
after rebuilding
tx
with the fix inSignalExchangeAPIWithSimpleUpdates
, error goes away as the offending entry is ignored (note the count 17 went down to 16)