Skip to content

Commit

Permalink
Merge pull request #49 from cooljeanius/autofix/alert-113-f8ea6e2493
Browse files Browse the repository at this point in the history
Fix code scanning alert no. 113: Binding a socket to all network interfaces
via Copilot Autofix
  • Loading branch information
cooljeanius authored Sep 27, 2024
2 parents e97adf0 + 2b92817 commit 13d64a5
Showing 1 changed file with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -146,21 +146,21 @@ def ghidra_trace_connect(address=None):
raise RuntimeError("port must be numeric")


def ghidra_trace_listen(address="0.0.0.0:0"):
def ghidra_trace_listen(address="127.0.0.1:0"):
"""
Listen for Ghidra to connect for tracing
Takes an optional address for the host and port on which to listen. Either
the form 'host:port' or just 'port'. If omitted, it will bind to an
ephemeral port on all interfaces. If only the port is given, it will bind to
that port on all interfaces. This command will block until the connection is
ephemeral port on localhost. If only the port is given, it will bind to
that port on localhost. This command will block until the connection is
established.
"""

STATE.require_no_client()
parts = address.split(":")
if len(parts) == 1:
host, port = "0.0.0.0", parts[0]
host, port = "127.0.0.1", parts[0]
elif len(parts) == 2:
host, port = parts
else:
Expand Down

0 comments on commit 13d64a5

Please sign in to comment.