diff options
author | Shauren <shauren.trinity@gmail.com> | 2017-11-25 22:28:30 +0100 |
---|---|---|
committer | Shauren <shauren.trinity@gmail.com> | 2017-11-25 22:28:30 +0100 |
commit | ce0054f03090a86f6e4f1efc0eee57659481cce1 (patch) | |
tree | 43f6538618d2f45da5b693137c29007703405365 /src/common/DataStores/DB2FileLoader.cpp | |
parent | df6e0538fe45fc012354dab9dd6542b1f29f81c5 (diff) |
Core/DataStores: Fixed possible out of bounds memory access
Diffstat (limited to 'src/common/DataStores/DB2FileLoader.cpp')
-rw-r--r-- | src/common/DataStores/DB2FileLoader.cpp | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/common/DataStores/DB2FileLoader.cpp b/src/common/DataStores/DB2FileLoader.cpp index 6e2b455f48d..ce174be43ca 100644 --- a/src/common/DataStores/DB2FileLoader.cpp +++ b/src/common/DataStores/DB2FileLoader.cpp @@ -1115,7 +1115,8 @@ char const* DB2FileLoaderSparseImpl::RecordGetString(unsigned char const* record uint32 DB2FileLoaderSparseImpl::RecordGetVarInt(unsigned char const* record, uint32 field, uint32 arrayIndex, bool isSigned) const { ASSERT(field < _header->FieldCount); - uint32 val = *reinterpret_cast<uint32 const*>(record + GetFieldOffset(field, arrayIndex)); + uint32 val = 0; + memcpy(&val, record + GetFieldOffset(field, arrayIndex), GetFieldSize(field)); EndianConvert(val); if (isSigned) return int32(val) << fields[field].UnusedBits >> fields[field].UnusedBits; |