fix missing group title length check

This fixes a buffer overflow when a malformed *.tox save file is
loaded.
This commit is contained in:
sudden6 2019-08-03 14:55:41 +02:00
parent 7418174129
commit 8ed83c3d4c
No known key found for this signature in database
GPG Key ID: 279509B499E032B9

View File

@ -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) {