Some more error checking for class names and tangible IDs
This commit is contained in:
@@ -80,11 +80,19 @@ class Deserializer {
|
||||
return;
|
||||
}
|
||||
case LUA_TT_TANGIBLE: {
|
||||
LS_.maketan(target, sb_->read_int64());
|
||||
int64_t tanid = sb_->read_int64();
|
||||
if (!LS_.validpositiveint64(tanid)) {
|
||||
throw DeserializeError();
|
||||
}
|
||||
LS_.maketan(target, tanid);
|
||||
return;
|
||||
}
|
||||
case LUA_TT_CLASS: {
|
||||
LS_.makeclass(target, sb_->read_string());
|
||||
eng::string name = sb_->read_string();
|
||||
if (!LS_.validclassname(name)) {
|
||||
throw DeserializeError();
|
||||
}
|
||||
LS_.makeclass(target, name);
|
||||
return;
|
||||
}
|
||||
case LUA_PK_REFERENCE: {
|
||||
|
||||
Reference in New Issue
Block a user