mirror of
https://github.com/irungentoo/toxcore.git
synced 2024-03-22 13:30:51 +08:00
fix missing group title length check
This fixes a buffer overflow when a malformed *.tox save file is loaded.
This commit is contained in:
parent
7418174129
commit
8ed83c3d4c
|
@ -3294,6 +3294,11 @@ static State_Load_Status load_conferences(Group_Chats *g_c, const uint8_t *data,
|
|||
}
|
||||
|
||||
g->title_len = *data;
|
||||
|
||||
if (g->title_len > MAX_NAME_LENGTH) {
|
||||
return STATE_LOAD_STATUS_ERROR;
|
||||
}
|
||||
|
||||
++data;
|
||||
|
||||
if (length < (uint32_t)(data - init_data) + g->title_len) {
|
||||
|
|
Loading…
Reference in New Issue
Block a user