mirror of
https://github.com/Tha14/toxic.git
synced 2024-11-26 14:13:27 +01:00
Fix possible null deref
This commit is contained in:
parent
e1576e23b7
commit
0907087439
@ -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