diff options
author | Loïc Blot <nerzhul@users.noreply.github.com> | 2017-06-19 14:10:30 +0200 |
---|---|---|
committer | SmallJoker <mk939@ymail.com> | 2018-06-03 17:31:59 +0200 |
commit | 5f796f7a042576f848e969c77b25b4b9e4112b77 (patch) | |
tree | a4e747cbd7dd10309fe8ee3974857bbfb653655e /src | |
parent | 7aa52fe4e195ad9d66f0bda51688b81d31391346 (diff) | |
download | minetest-5f796f7a042576f848e969c77b25b4b9e4112b77.tar.gz minetest-5f796f7a042576f848e969c77b25b4b9e4112b77.tar.bz2 minetest-5f796f7a042576f848e969c77b25b4b9e4112b77.zip |
Verify HudSetParams input when hotbar textures are set (#6013)
* Verify HudSetParams input when hotbar textures are set
This fix #6011
Diffstat (limited to 'src')
-rw-r--r-- | src/network/clientpackethandler.cpp | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/src/network/clientpackethandler.cpp b/src/network/clientpackethandler.cpp index 59669fe6d..8935ed90c 100644 --- a/src/network/clientpackethandler.cpp +++ b/src/network/clientpackethandler.cpp @@ -1172,9 +1172,21 @@ void Client::handleCommand_HudSetParam(NetworkPacket* pkt) player->hud_hotbar_itemcount = hotbar_itemcount; } else if (param == HUD_PARAM_HOTBAR_IMAGE) { + // If value not empty verify image exists in texture source + if (value != "" && !getTextureSource()->isKnownSourceImage(value)) { + errorstream << "Server sent wrong Hud hotbar image (sent value: '" + << value << "')" << std::endl; + return; + } player->hotbar_image = value; } else if (param == HUD_PARAM_HOTBAR_SELECTED_IMAGE) { + // If value not empty verify image exists in texture source + if (value != "" && !getTextureSource()->isKnownSourceImage(value)) { + errorstream << "Server sent wrong Hud hotbar selected image (sent value: '" + << value << "')" << std::endl; + return; + } player->hotbar_selected_image = value; } } |