fix: 9 bug fixes — thread safety, error handling, mutable defaults#2889
Open
verysleepylemon wants to merge 1 commit intosherlock-project:masterfrom
Open
Conversation
Bug fixes:
1. notify.py: Replace non-thread-safe global counter (globvar) with
threading.Lock-protected _results_count — fixes race conditions
when multiple queries run concurrently
2. notify.py: Add getResults() to read count without incrementing;
fix off-by-one in finish() display
3. sherlock.py: Normalise errorType to list before checking — handles
sites that declare multiple error detection methods
4. sherlock.py: Remove .encode() on r.text — r.text is already a
decoded str, double-encoding produced bytes where str was expected
5. sherlock.py: Add null-check (r is not None) before WAF fingerprint
scan — prevents AttributeError on timed-out requests
6. sherlock.py: Change --print-found (store_true, default=True — a
no-op) to --no-print-found (store_false) so users can actually
suppress found-site output
7. sherlock.py: Use lstrip('v').lstrip('release-') for version tag
comparison — handles tags like 'release-0.16.0'
8. sites.py: Replace mutable default argument
username_unclaimed=secrets.token_urlsafe(10) with None sentinel;
honour caller-supplied value instead of always overwriting with
a new random token
9. sites.py: Replace mutable default argument do_not_exclude=[] with
None sentinel — prevents shared-state bug across calls
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Nine targeted bug fixes across three core modules. No new features, no dependencies added.
notify.py — Thread-safe result counter
sherlock.py — Error handling & CLI fixes
sites.py — Mutable default arguments
Testing