s integer overflow, unsafe cast

This commit is contained in:
Nikita Edel
2026-03-11 16:10:48 +01:00
parent a24f9f5a5e
commit ed13020cf3
7 changed files with 28 additions and 23 deletions

View File

@@ -135,11 +135,11 @@ MerchantRecipeList *MerchantRecipeList::createFromStream(DataInputStream *stream
void MerchantRecipeList::load(CompoundTag *tag)
{
ListTag<CompoundTag> *list = (ListTag<CompoundTag> *) tag->getList(L"Recipes");
ListTag<Tag> *list = tag->getList(L"Recipes");
for (int i = 0; i < list->size(); i++)
{
CompoundTag *recipeTag = list->get(i);
CompoundTag *recipeTag = (CompoundTag*) list->get(i);
m_recipes.push_back(new MerchantRecipe(recipeTag));
}
}
@@ -192,4 +192,4 @@ size_t MerchantRecipeList::size()
bool MerchantRecipeList::empty()
{
return m_recipes.empty();
}
}