diff options
| author | levlam <levlam@telegram.org> | 2026-06-30 13:43:22 +0300 |
|---|---|---|
| committer | levlam <levlam@telegram.org> | 2026-06-30 13:43:22 +0300 |
| commit | c52d9af6656ef27f59b10d9a351673ff338eb2f1 (patch) | |
| tree | eb163b2ae7d42db847640daf1997ea3c2027c3ad /td/telegram/WebPageBlock.cpp | |
| parent | ce44f21aa4bb894cca381c47b4286f60e4f65280 (diff) | |
Improve inputPageBlockMap checks.
Diffstat (limited to 'td/telegram/WebPageBlock.cpp')
| -rw-r--r-- | td/telegram/WebPageBlock.cpp | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/td/telegram/WebPageBlock.cpp b/td/telegram/WebPageBlock.cpp index 36ba23f3d..8f34e57a5 100644 --- a/td/telegram/WebPageBlock.cpp +++ b/td/telegram/WebPageBlock.cpp @@ -5187,9 +5187,10 @@ Result<vector<unique_ptr<WebPageBlock>>> get_web_page_blocks( if (location.empty()) { return Status::Error(400, "Invalid location specified"); } - if (block->zoom_ < 0 || block->zoom_ > 25 || block->width_ < 0 || block->width_ >= 65536 || - block->height_ < 0 || block->height_ >= 65536) { - return Status::Error(400, "Invalid location parameters specified"); + if (block->zoom_ < 0 || block->zoom_ >= 25 || block->width_ < 0 || block->width_ > 10000 || + block->height_ < 0 || block->height_ > 10000 || block->width_ + block->height_ > 10000 || + block->width_ > block->height_ * 20 || block->height_ > block->width_ * 20) { + return Status::Error(400, "Invalid map properties specified"); } TRY_RESULT(caption, WebPageBlockCaption::get_web_page_block_caption(td, std::move(block->caption_))); result.push_back(td::make_unique<WebPageBlockMap>( |
