mirror of
https://github.com/sshuttle/sshuttle.git
synced 2025-04-21 17:58:39 +02:00
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
bd05a7276a
commit
11d550cca7
@ -20,7 +20,7 @@ def ipt_chain_exists(family, table, name):
|
|||||||
argv = [cmd, '-w', '-t', table, '-nL']
|
argv = [cmd, '-w', '-t', table, '-nL']
|
||||||
try:
|
try:
|
||||||
output = ssubprocess.check_output(argv, env=get_env())
|
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):
|
if line.startswith('Chain %s ' % name):
|
||||||
return True
|
return True
|
||||||
except ssubprocess.CalledProcessError as e:
|
except ssubprocess.CalledProcessError as e:
|
||||||
|
Loading…
Reference in New Issue
Block a user