Skip to content

Commit

Permalink
fix missing group title length check
Browse files Browse the repository at this point in the history
This fixes a buffer overflow when a malformed *.tox save file is
loaded.
  • Loading branch information
sudden6 committed Aug 3, 2019
1 parent 7aab0d9 commit fbbf6cf
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions toxcore/group.c
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down

0 comments on commit fbbf6cf

Please sign in to comment.