Skip to content

Commit 4dcc598

Browse files
authoredJun 19, 2017
Verify HudSetParams input when hotbar textures are set (#6013)
* Verify HudSetParams input when hotbar textures are set This fix #6011
1 parent 0c429bd commit 4dcc598

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed
 

‎src/network/clientpackethandler.cpp

+12
Original file line numberDiff line numberDiff line change
@@ -1174,9 +1174,21 @@ void Client::handleCommand_HudSetParam(NetworkPacket* pkt)
11741174
player->hud_hotbar_itemcount = hotbar_itemcount;
11751175
}
11761176
else if (param == HUD_PARAM_HOTBAR_IMAGE) {
1177+
// If value not empty verify image exists in texture source
1178+
if (value != "" && !getTextureSource()->isKnownSourceImage(value)) {
1179+
errorstream << "Server sent wrong Hud hotbar image (sent value: '"
1180+
<< value << "')" << std::endl;
1181+
return;
1182+
}
11771183
player->hotbar_image = value;
11781184
}
11791185
else if (param == HUD_PARAM_HOTBAR_SELECTED_IMAGE) {
1186+
// If value not empty verify image exists in texture source
1187+
if (value != "" && !getTextureSource()->isKnownSourceImage(value)) {
1188+
errorstream << "Server sent wrong Hud hotbar selected image (sent value: '"
1189+
<< value << "')" << std::endl;
1190+
return;
1191+
}
11801192
player->hotbar_selected_image = value;
11811193
}
11821194
}

0 commit comments

Comments
 (0)
Please sign in to comment.