Skip to content

Commit bfa7135

Browse files
authored
Merge pull request #38 from openziti/bugfix/terminator_regression
Ensure terminator_b is assigned before its referenced
2 parents 591fdfc + cfb1fa8 commit bfa7135

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

src/openziti/zitilib.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -244,6 +244,7 @@ def load(path):
244244

245245
def connect(fd, ztx, service: str, terminator: Optional[str] = None):
246246
srv = bytes(service, encoding='utf-8')
247+
terminator_b = None
247248
if terminator:
248249
terminator_b = bytes(terminator, encoding='utf-8')
249250
check_error(_ziti_connect(fd, ztx, srv, terminator_b))
@@ -257,6 +258,7 @@ def connect_addr(fd, addr: Tuple[str, int]):
257258

258259
def bind(fd, ztx, service: str, terminator: Optional[str] = None):
259260
srv = bytes(service, encoding='utf-8')
261+
terminator_b = None
260262
if terminator:
261263
terminator_b = bytes(terminator, encoding='utf-8')
262264
check_error(_ziti_bind(fd, ztx, srv, terminator_b))

0 commit comments

Comments
 (0)