From 154d11acc0afdf3639e6a07c931e35674102e44a Mon Sep 17 00:00:00 2001 From: Machiavelli Date: Sat, 25 Sep 2010 01:02:40 +0200 Subject: Core/DBLayer: - Fix another pesky linux specific compile error. (Thanks to Derex/Aokromes) - Fix a typo in an assertion. (Thanks to Derex/Aokromes) - Add proper zero termination in SetStructuredValue to get rid of memory issues that arose in the last few commits. - Fix a crash caused by vsprintf´ing std::string in SystemMgr::LoadVersion() MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --HG-- branch : trunk --- src/server/shared/Database/Field.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/server/shared/Database/Field.cpp') diff --git a/src/server/shared/Database/Field.cpp b/src/server/shared/Database/Field.cpp index f1f9df6f1f7..7afcbdfedaf 100644 --- a/src/server/shared/Database/Field.cpp +++ b/src/server/shared/Database/Field.cpp @@ -30,7 +30,7 @@ Field::~Field() CleanUp(); } -void Field::SetByteValue(void* newValue, const size_t newSize, enum_field_types newType, uint32 length) +void Field::SetByteValue(const void* newValue, const size_t newSize, enum_field_types newType, uint32 length) { // This value stores raw bytes that have to be explicitly casted later if (newValue) @@ -50,7 +50,7 @@ void Field::SetStructuredValue(char* newValue, enum_field_types newType, const s { size_t size = strlen(newValue); data.value = new char [size+1]; - memcpy(data.value, newValue, size); + strcpy((char*)data.value, newValue); data.length = size; } -- cgit v1.2.3