Core/String: Fix (Un)Serialize not checking string read/write
Former-commit-id: 8d6f907fcaf20374b713851a102dfc4b0003a39d
This commit is contained in:
parent
35b27bbe67
commit
a47e5633d4
|
|
@ -4214,8 +4214,7 @@ namespace Nz
|
||||||
if (!Serialize<UInt32>(context, string.GetSize()))
|
if (!Serialize<UInt32>(context, string.GetSize()))
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
context.stream->Write(string.GetConstBuffer(), string.GetSize());
|
return context.stream->Write(string.GetConstBuffer(), string.GetSize()) == string.GetSize();
|
||||||
return true;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
bool Unserialize(UnserializationContext& context, String* string)
|
bool Unserialize(UnserializationContext& context, String* string)
|
||||||
|
|
@ -4225,8 +4224,7 @@ namespace Nz
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
string->Resize(size);
|
string->Resize(size);
|
||||||
context.stream->Read(string->GetBuffer(), size);
|
return context.stream->Read(string->GetBuffer(), size) == size;
|
||||||
return true;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
const unsigned int String::npos(std::numeric_limits<unsigned int>::max());
|
const unsigned int String::npos(std::numeric_limits<unsigned int>::max());
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue