Skip to content

find_server() can return None and crash the client #2

@davidnoyes

Description

@davidnoyes

Bug Description

If the UDP message received on port 50001 doesn't start with "CHAT_SERVER", the function skips the if block and returns None. The client then tries to unpack it:

server_ip, server_port = find_server()  # TypeError: cannot unpack non-iterable NoneType

Any rogue UDP traffic on port 50001 that arrives before the real server broadcast will crash the client. The socket also leaks (never closed) in this case.

File & Lines

client code 2.py — lines 93–107, 623

Severity

Critical — any stray UDP packet on port 50001 crashes the client.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions