Skip to content

Crash if node id malformed  #47

@znjp

Description

@znjp

If a connecting client sends a malformed id/port message, server will throw an uncaught exception.

In run(), I threw a try/except around the split to catch the error, but maybe there are better solutions?

                   if ":" in connected_node_id:
                        print("Got connected node id", connected_node_id)
                        try:
                                (connected_node_id, connected_node_port) = connected_node_id.split(':') # When a node is connected, it sends it id!
                        except Exception as e:
                                print(e)
                                connection.close()
                                continue

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions