Description

Pointed out by a licensee here:

UDataTableを読みこんだ際のメモリ破壊について

When reading the `UDataTable, in DataTable::LoadStructData()` the contents of the struct are interpreted[Image Removed], but the size of memory that is allocated and the size of memory that is initialized to zero seem to be different. The memory allocation is done here in `DataTable::LoadStructData()` in DataTable.cpp :
`uint8* RowData = (uint8*)FMemory::Malloc(LoadUsingStruct->PropertiesSize);`
But the memory zero initialization is done in Class.cpp's `UScriptStruct::InitializeStruct()` :
`FMemory::Memzero(Dest, ArrayDim * Stride);`
The stride value is set to `GetStructureSize()`, but the return value of `GetStructureSize` is `Align(PropertiesSize,MinAlignment)`, so it's actually a little larger than the allocated size.
Because of this, the information about the memory allocation gets corrupted.
In order to fix this, I was planning on fixing the allocation part, but would that be correct?

Steps to Reproduce

Check with Joe Conley

Have Comments or More Details?

There's no existing public thread on this issue, so head over to Questions & Answers just mention UE-36849 in the post.

0
Login to Vote

Fixed
ComponentUE - Foundation - Core
Affects Versions4.114.124.134.14
Target Fix4.14
Fix Commit3152652
Main Commit3172200
Release Commit3159180
CreatedOct 5, 2016
ResolvedOct 5, 2016
UpdatedApr 27, 2018
View Jira Issue