diff options
Diffstat (limited to 'toxcore/Messenger.c')
-rw-r--r-- | toxcore/Messenger.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/toxcore/Messenger.c b/toxcore/Messenger.c index 3b09baa2..fef2e9e5 100644 --- a/toxcore/Messenger.c +++ b/toxcore/Messenger.c | |||
@@ -821,6 +821,8 @@ static void group_message_function(Group_Chat *chat, int peer_number, uint8_t *m | |||
821 | if (i == -1) | 821 | if (i == -1) |
822 | return; | 822 | return; |
823 | 823 | ||
824 | message[length - 1] = 0; /* Force NULL terminator */ | ||
825 | |||
824 | if (m->group_message) | 826 | if (m->group_message) |
825 | (*m->group_message)(m, i, peer_number, message, length, m->group_message_userdata); | 827 | (*m->group_message)(m, i, peer_number, message, length, m->group_message_userdata); |
826 | } | 828 | } |
@@ -833,6 +835,8 @@ static void group_action_function(Group_Chat *chat, int peer_number, uint8_t *ac | |||
833 | if (i == -1) | 835 | if (i == -1) |
834 | return; | 836 | return; |
835 | 837 | ||
838 | action[length - 1] = 0; /* Force NULL terminator */ | ||
839 | |||
836 | if (m->group_action) | 840 | if (m->group_action) |
837 | (*m->group_action)(m, i, peer_number, action, length, m->group_action_userdata); | 841 | (*m->group_action)(m, i, peer_number, action, length, m->group_action_userdata); |
838 | } | 842 | } |
@@ -1848,6 +1852,8 @@ void do_friends(Messenger *m) | |||
1848 | m->friendlist[i].file_receiving[filenumber].size = filesize; | 1852 | m->friendlist[i].file_receiving[filenumber].size = filesize; |
1849 | m->friendlist[i].file_receiving[filenumber].transferred = 0; | 1853 | m->friendlist[i].file_receiving[filenumber].transferred = 0; |
1850 | 1854 | ||
1855 | data[data_length - 1] = 0; /* Force NULL terminate file name. */ | ||
1856 | |||
1851 | if (m->file_sendrequest) | 1857 | if (m->file_sendrequest) |
1852 | (*m->file_sendrequest)(m, i, filenumber, filesize, data + 1 + sizeof(uint64_t), data_length - 1 - sizeof(uint64_t), | 1858 | (*m->file_sendrequest)(m, i, filenumber, filesize, data + 1 + sizeof(uint64_t), data_length - 1 - sizeof(uint64_t), |
1853 | m->file_sendrequest_userdata); | 1859 | m->file_sendrequest_userdata); |