mirror of
https://github.com/Tha14/toxic.git
synced 2024-12-22 17:03:26 +01:00
Fix possible null deref
This commit is contained in:
parent
27259ff23f
commit
9a629072b3
@ -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;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user