Don't resize to negative size if reading length fails for any reason

This commit is contained in:
baldurk
2018-08-07 11:40:15 +01:00
parent feee30c15e
commit fee02414cb
+5 -2
View File
@@ -82,8 +82,11 @@ void Command::Recv(StreamReader &reader)
}
data.clear();
data.resize(length - 11);
reader.Read(&data[0], data.size());
if(length >= 11)
{
data.resize(length - 11);
reader.Read(&data[0], data.size());
}
}
CommandData Command::GetData()