1
0
mirror of https://github.com/TerryCavanagh/VVVVVV.git synced 2024-06-28 15:38:30 +02:00

Initialize temporary edentity when loading levels

It is possible for any of the QueryIntAttribute()s to fail, most
commonly if the attributes don't exist. If that happens, then that part
of the temporary edentity won't be initialized, and we'll end up having
a partially-uninitialized edentity - then doing much of anything with it
will result in undefined behavior.

To fix this, just initialize the temporary edentity.
This commit is contained in:
Misa 2021-03-24 12:21:28 -07:00 committed by Ethan Lee
parent 69b0f0b650
commit 4e52dccdae

View File

@ -1783,7 +1783,7 @@ bool editorclass::load(std::string& _path)
{
for( tinyxml2::XMLElement* edEntityEl = pElem->FirstChildElement(); edEntityEl; edEntityEl=edEntityEl->NextSiblingElement())
{
edentities entity;
edentities entity = edentities();
const char* text = edEntityEl->GetText();
if (text != NULL)