summaryrefslogtreecommitdiff
path: root/core
diff options
context:
space:
mode:
Diffstat (limited to 'core')
-rw-r--r--core/Messenger.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/core/Messenger.c b/core/Messenger.c
index f1d8b35e..b1050230 100644
--- a/core/Messenger.c
+++ b/core/Messenger.c
@@ -541,6 +541,8 @@ static void doFriends(void)
541 break; 541 break;
542 } 542 }
543 case PACKET_ID_STATUSMESSAGE: { 543 case PACKET_ID_STATUSMESSAGE: {
544 if (len < 2)
545 break;
544 uint8_t *status = calloc(MIN(len - 1, MAX_STATUSMESSAGE_LENGTH), 1); 546 uint8_t *status = calloc(MIN(len - 1, MAX_STATUSMESSAGE_LENGTH), 1);
545 memcpy(status, temp + 1, MIN(len - 1, MAX_STATUSMESSAGE_LENGTH)); 547 memcpy(status, temp + 1, MIN(len - 1, MAX_STATUSMESSAGE_LENGTH));
546 if (friend_statusmessagechange_isset) 548 if (friend_statusmessagechange_isset)
@@ -550,6 +552,8 @@ static void doFriends(void)
550 break; 552 break;
551 } 553 }
552 case PACKET_ID_USERSTATUS: { 554 case PACKET_ID_USERSTATUS: {
555 if (len != 2)
556 break;
553 USERSTATUS status = *(temp + 1); 557 USERSTATUS status = *(temp + 1);
554 if (friend_userstatuschange_isset) 558 if (friend_userstatuschange_isset)
555 friend_userstatuschange(i, status); 559 friend_userstatuschange(i, status);