From dcf3db3e98f7ff0b926a568062bdb130c802a556 Mon Sep 17 00:00:00 2001 From: levlam Date: Thu, 3 Oct 2019 18:16:11 +0300 Subject: [PATCH] Fix parse_sticker_set with an invalid sticker. GitOrigin-RevId: 66734835e21c35fb3978f2311b9d582d1b65f0e6 --- td/telegram/StickersManager.hpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/td/telegram/StickersManager.hpp b/td/telegram/StickersManager.hpp index 63f91775c..ce158c64e 100644 --- a/td/telegram/StickersManager.hpp +++ b/td/telegram/StickersManager.hpp @@ -262,6 +262,9 @@ void StickersManager::parse_sticker_set(StickerSet *sticker_set, ParserT &parser if (parser.get_error() != nullptr) { return; } + if (!sticker_id.is_valid()) { + return parser.set_error("Receive invalid sticker in a sticker set"); + } sticker_set->sticker_ids.push_back(sticker_id); Sticker *sticker = get_sticker(sticker_id);