BMessage::ReplaceData: potential corruption on realloc fail

The method would update the field offsets first, and would not restore
them in case of realloc failure, leaving them pointing to the wrong
place.
This commit is contained in:
Adrien Destugues
2014-12-24 11:52:02 +01:00
parent 4c0fbf2e52
commit a6f1bc984d
2 changed files with 25 additions and 7 deletions
+1
View File
@@ -510,6 +510,7 @@ private:
status_t _ValidateMessage();
void _UpdateOffsets(uint32 offset, int32 change);
status_t _ResizeData(uint32 offset, int32 change);
uint32 _HashName(const char* name) const;