Fixed a crash in plugin mod_chat_only.
This commit is contained in:
parent
2e8c99b7ec
commit
0a7cb86014
@ -64,13 +64,13 @@ static struct user_info* get_user_info(struct chat_only_data* data, sid_t sid)
|
|||||||
struct user_info* u;
|
struct user_info* u;
|
||||||
|
|
||||||
// resize buffer if needed.
|
// resize buffer if needed.
|
||||||
if (sid > data->max_users) // FIXME: >= ?
|
if (sid >= data->max_users)
|
||||||
{
|
{
|
||||||
u = hub_malloc_zero(sizeof(struct user_info) * (sid + 1));
|
u = hub_malloc_zero(sizeof(struct user_info) * (sid + 1));
|
||||||
memcpy(u, data->users, data->max_users);
|
memcpy(u, data->users, data->max_users);
|
||||||
hub_free(data->users);
|
hub_free(data->users);
|
||||||
data->users = u;
|
data->users = u;
|
||||||
data->max_users = sid;
|
data->max_users = sid + 1;
|
||||||
u = NULL;
|
u = NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user