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.
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. https://github.com/smartnode/telebot/blob/c74d78d2a4822aa2d475b5627105288132e4b0c2/src/telebot-parser.c#L485-L494 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, astelebot_put_user
sees non-null pointers and tries to free them. This causes memory corruption and an eventual crash.