Skip to content

Commit f62df1a

Browse files
vlkumiloslearningclaude
andcommitted
fix: Process.exists() returns True when tool is missing due to operator precedence bug
`not stdout == stderr == ''` is evaluated as `not (stdout == stderr == '')` which returns True when stderr is non-empty (e.g. "service not found"), causing wifite to believe the tool exists and then crash with FileNotFoundError. Replace with `bool(stdout)` — which is non-empty only when `which` actually found the binary. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
1 parent e5fc123 commit f62df1a

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

wifite/util/process.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -204,7 +204,7 @@ def exists(program):
204204
stdout = p2.stdout().strip()
205205
stderr = p2.stderr().strip()
206206

207-
exist = not stdout == stderr == ''
207+
exist = bool(stdout)
208208
if Configuration.initialized:
209209
Configuration.existing_commands.update({program: exist})
210210
return exist

0 commit comments

Comments
 (0)