1
0
mirror of https://github.com/Tha14/toxic.git synced 2025-07-02 13:06:45 +02:00

Fix potential int truncation and double-check lengths before copy

This commit is contained in:
jfreegman
2017-08-28 19:37:19 -04:00
parent 80c0500299
commit 52dd60dc86
2 changed files with 14 additions and 5 deletions

View File

@ -44,7 +44,7 @@ struct GroupChatInvite {
typedef struct {
char name[TOXIC_MAX_NAME_LENGTH + 1];
int namelength;
uint16_t namelength;
char statusmsg[TOX_MAX_STATUS_MESSAGE_LENGTH + 1];
size_t statusmsg_len;
char pub_key[TOX_PUBLIC_KEY_SIZE];
@ -65,7 +65,7 @@ typedef struct {
typedef struct {
char name[TOXIC_MAX_NAME_LENGTH + 1];
int namelength;
uint16_t namelength;
char pub_key[TOX_PUBLIC_KEY_SIZE];
uint32_t num;
bool active;