Skip to content

Commit e173eb6

Browse files
vieirabrianmay
authored andcommitted
Skip empty lines on incoming routes data
If we receive no routes from server or if, for some reason, we receive some empty lines, we should skip them instead of crashing. Fixes on of the problems in sshuttle#147.
1 parent 29cd75b commit e173eb6

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

sshuttle/client.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -489,6 +489,7 @@ def _main(tcp_listener, udp_listener, fw, ssh_cmd, remotename,
489489
def onroutes(routestr):
490490
if auto_nets:
491491
for line in routestr.strip().split(b'\n'):
492+
if not line: break
492493
(family, ip, width) = line.split(b',', 2)
493494
family = int(family)
494495
width = int(width)

0 commit comments

Comments
 (0)