From 05b279bb132393aafda8782df070af01aba7c82c Mon Sep 17 00:00:00 2001 From: levlam Date: Fri, 22 May 2020 18:07:04 +0300 Subject: [PATCH] Never trust peers sticker set name in secret chats. GitOrigin-RevId: 11f6534963920bd7c736a9cb3dcf3c73e2e68e6c --- td/telegram/StickersManager.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/td/telegram/StickersManager.cpp b/td/telegram/StickersManager.cpp index 7ec8291c..30c26728 100644 --- a/td/telegram/StickersManager.cpp +++ b/td/telegram/StickersManager.cpp @@ -1868,7 +1868,9 @@ StickerSetId StickersManager::on_get_input_sticker_set(FileId sticker_file_id, } })); } - return set_id; + // always return empty StickerSetId, because we can't trust the set_id provided by the peer in the secret chat + // the real sticker set id will be set in on_get_sticker if and only if the sticker is really from the set + return StickerSetId(); } case telegram_api::inputStickerSetAnimatedEmoji::ID: return add_special_sticker_set(SpecialStickerSetType(set_ptr).type_).id_;