Hello all!
I’m trying to use the protobuf version (3.18.0) included in Unreal, using the engine’s compiled source code.
void InstallationApplicationService::CreateInstallation(const google::protobuf::Message& Message)
{
const Installation& InstallationMessage = static_cast<const Installation&>(Message);
UE_LOG(LogTemp, Log, TEXT("InstallationMessage DebugString: %s"), *FString(InstallationMessage.DebugString().c_str()));
UE_LOG(LogTemp, Log, TEXT("InstallationMessage length: %d"), InstallationMessage.length());
}
The message is well formed and valid.
InstallationMessage.DebugString() correctly print the contained informations :
InstallationMessage DebugString: installation_id: "123"
name: "Test"
length: 10
width: 15.5
But it crashes when accessing different attributes, regardless of their type.
I guess because of poorly deserialized field: int, float, string size have huge value, like
InstallationMessage length: -244143296
Do you know if there are any issues with this version of protobuf in c++?
And so trying a newer version can resolve this, or do you know any other issue with the static_cast of a generated protobuf class?