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

Fix a bunch of misc bugs and corner cases

This commit is contained in:
Jfreegman
2015-11-08 03:57:01 -05:00
parent 14a8bdb874
commit fa0e645a79
12 changed files with 99 additions and 50 deletions

View File

@ -238,7 +238,7 @@ int load_blocklist(char *path)
memcpy(&tmp, data + i * sizeof(BlockedFriend), sizeof(BlockedFriend));
Blocked.list[i].active = true;
Blocked.list[i].num = i;
Blocked.list[i].namelength = ntohs(tmp.namelength);
Blocked.list[i].namelength = MIN(TOXIC_MAX_NAME_LENGTH, ntohs(tmp.namelength));
memcpy(Blocked.list[i].name, tmp.name, Blocked.list[i].namelength + 1);
memcpy(Blocked.list[i].pub_key, tmp.pub_key, TOX_PUBLIC_KEY_SIZE);