mirror of
https://github.com/EQEmu/Server.git
synced 2026-04-20 01:12:36 +00:00
Harden inspect message handling
Co-authored-by: Valorith <76063792+Valorith@users.noreply.github.com>
This commit is contained in:
parent
58e007a50f
commit
e02da5ba4a
@ -1853,7 +1853,7 @@ void SharedDatabase::LoadCharacterInspectMessage(uint32 character_id, InspectMes
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
memcpy(s, e.inspect_message.c_str(), sizeof(InspectMessage_Struct));
|
strn0cpy(s->text, e.inspect_message.c_str(), sizeof(s->text));
|
||||||
}
|
}
|
||||||
|
|
||||||
void SharedDatabase::SaveCharacterInspectMessage(uint32 character_id, const InspectMessage_Struct* s)
|
void SharedDatabase::SaveCharacterInspectMessage(uint32 character_id, const InspectMessage_Struct* s)
|
||||||
|
|||||||
@ -74,7 +74,7 @@ struct function : public function_base, function_traits<T>
|
|||||||
|
|
||||||
std::string get_signature() const override
|
std::string get_signature() const override
|
||||||
{
|
{
|
||||||
return util::type_name<target_t>::str();
|
return util::type_name<return_t>::str() + "(" + util::type_name<typename function::sig_t>::str() + ")";
|
||||||
};
|
};
|
||||||
|
|
||||||
bool is_compatible(xsub_stack& stack) const override
|
bool is_compatible(xsub_stack& stack) const override
|
||||||
|
|||||||
@ -9062,10 +9062,10 @@ void Client::Handle_OP_InspectAnswer(const EQApplicationPacket *app)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
auto message = (InspectMessage_Struct *) insr->text;
|
auto message = reinterpret_cast<InspectMessage_Struct *>(insr->text);
|
||||||
auto inspect_message = GetInspectMessage();
|
auto &inspect_message = GetInspectMessage();
|
||||||
|
|
||||||
memcpy(&inspect_message, message, sizeof(InspectMessage_Struct));
|
strn0cpy(inspect_message.text, message->text, sizeof(inspect_message.text));
|
||||||
database.SaveCharacterInspectMessage(CharacterID(), &inspect_message);
|
database.SaveCharacterInspectMessage(CharacterID(), &inspect_message);
|
||||||
|
|
||||||
if (
|
if (
|
||||||
@ -9084,9 +9084,9 @@ void Client::Handle_OP_InspectMessageUpdate(const EQApplicationPacket *app)
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
InspectMessage_Struct* newmessage = (InspectMessage_Struct*)app->pBuffer;
|
auto *newmessage = reinterpret_cast<const InspectMessage_Struct *>(app->pBuffer);
|
||||||
InspectMessage_Struct& playermessage = GetInspectMessage();
|
auto &playermessage = GetInspectMessage();
|
||||||
memcpy(&playermessage, newmessage, sizeof(InspectMessage_Struct));
|
strn0cpy(playermessage.text, newmessage->text, sizeof(playermessage.text));
|
||||||
database.SaveCharacterInspectMessage(CharacterID(), &playermessage);
|
database.SaveCharacterInspectMessage(CharacterID(), &playermessage);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user