1
0
mirror of https://github.com/Tha14/toxic.git synced 2024-11-22 20:33:02 +01:00

Fix possible null deref

This commit is contained in:
jfreegman 2021-12-15 13:15:50 -05:00
parent e1576e23b7
commit 0907087439
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;