Crash on messages forwarded from chats
Closed this issue · 0 comments
pt300 commented
Telebot crashes when freeing updates object if one of the messages was a forward from a chat.
I traced the problem to line 488 in telebot-parser.c, which seems to be a mistake when copy pasting similar code.
Lines 485 to 494 in c74d78d
It ought to be
msg->forward_from_chat = malloc(sizeof(telebot_chat_t));
.
This causes a bug in which msg->forward_from
is overwritten with a pointer to uninitialized memory. This causes issues during freeing, as telebot_put_user
sees non-null pointers and tries to free them. This causes memory corruption and an eventual crash.