1
0
mirror of https://github.com/Tha14/toxic.git synced 2024-11-14 05:53:01 +01:00

Fix possible null deref

This commit is contained in:
jfreegman 2021-12-15 13:15:50 -05:00
parent 27259ff23f
commit 9a629072b3
No known key found for this signature in database
GPG Key ID: 3627F3144076AE63

View File

@ -779,6 +779,11 @@ static void chat_onGroupInvite(ToxWindow *self, Tox *m, uint32_t friendnumber, c
}
Friends.list[friendnumber].group_invite.data = malloc(length * sizeof(uint8_t));
if (Friends.list[friendnumber].group_invite.data == NULL) {
return;
}
memcpy(Friends.list[friendnumber].group_invite.data, invite_data, length);
Friends.list[friendnumber].group_invite.length = length;