prevent bogus name ownership

This commit is contained in:
hippoz 2022-12-25 21:56:37 +02:00
parent 18ec9899f7
commit 438a1a85e8
Signed by: hippoz
GPG key ID: 56C4E02A85F2FBED

View file

@ -133,7 +133,7 @@ int jb_server_client_assign_unique_name(struct jb_server *s, int i)
int jb_server_client_assign_own_name(struct jb_server *s, int i, char *name)
{
struct jb_client *c = &s->clients[i];
if (c->owned_name_index != -1) {
if (c->owned_name_index != -1 || !name || *name == ':' || *name == '\0') {
return -1;
}