Fixed a crash in plugin mod_chat_only.

This commit is contained in:
Jan Vidar Krey 2012-10-02 23:01:57 +02:00
parent 2e8c99b7ec
commit 0a7cb86014
1 changed files with 2 additions and 2 deletions

View File

@ -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;
} }