Add CodeQL for GitHub code scanning (#1548)

* Create codeql.yml

* Addressing codeql findings
This commit is contained in:
LordGrey
2022-12-27 08:36:10 +01:00
committed by GitHub
parent 1189f86c1a
commit 6fa7bab6f7
83 changed files with 1984 additions and 2094 deletions

View File

@@ -153,10 +153,9 @@ to this service over the network.
srv = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)
srv.setsockopt(socket.SOL_SOCKET, socket.SO_REUSEADDR, 1)
srv.bind(('0.0.0.0', args.localport)) # lgtm [py/bind-socket-all-network-interfaces]
srv.bind(('0.0.0.0', args.localport))
try:
intentional_exit = False
while True:
try:
while True:
@@ -180,7 +179,7 @@ to this service over the network.
# probably got disconnected
break
except KeyboardInterrupt:
intentional_exit = True
# intentional_exit
raise
except socket.error as msg:
if args.develop:
@@ -190,6 +189,7 @@ to this service over the network.
ser_to_net.socket = None
sys.stderr.write('Disconnected\n')
except KeyboardInterrupt:
# do not handle exceptions
pass
sys.stderr.write('\n--- exit ---\n')