mirror of
https://github.com/sshuttle/sshuttle.git
synced 2025-02-10 15:40:54 +01:00
fix: prevent UnicodeDecodeError parsing iptables rule with comments
If one or more iptables rule contains a comment with a non-unicode character, an UnicodeDecodeError would be raised.
This commit is contained in:
parent
340ccc705e
commit
cbe3d1e402
@ -20,7 +20,7 @@ def ipt_chain_exists(family, table, name):
|
||||
argv = [cmd, '-w', '-t', table, '-nL']
|
||||
try:
|
||||
output = ssubprocess.check_output(argv, env=get_env())
|
||||
for line in output.decode('ASCII').split('\n'):
|
||||
for line in output.decode('ASCII', errors='replace').split('\n'):
|
||||
if line.startswith('Chain %s ' % name):
|
||||
return True
|
||||
except ssubprocess.CalledProcessError as e:
|
||||
|
Loading…
Reference in New Issue
Block a user