mirror of
https://github.com/ddnet/ddnet.git
synced 2024-11-14 20:18:19 +00:00
fixed a server crash due to faulty offsets. #1173
This commit is contained in:
parent
7cb173ec53
commit
77478707f2
|
@ -98,12 +98,11 @@ class CConsole : public IConsole
|
||||||
if(this != &Other)
|
if(this != &Other)
|
||||||
{
|
{
|
||||||
IResult::operator=(Other);
|
IResult::operator=(Other);
|
||||||
int Offset = m_aStringStorage - Other.m_aStringStorage;
|
|
||||||
mem_copy(m_aStringStorage, Other.m_aStringStorage, sizeof(m_aStringStorage));
|
mem_copy(m_aStringStorage, Other.m_aStringStorage, sizeof(m_aStringStorage));
|
||||||
m_pArgsStart = Other.m_pArgsStart + Offset;
|
m_pArgsStart = m_aStringStorage+(Other.m_pArgsStart-Other.m_aStringStorage);
|
||||||
m_pCommand = Other.m_pCommand + Offset;
|
m_pCommand = m_aStringStorage+(Other.m_pCommand-Other.m_aStringStorage);
|
||||||
for(unsigned i = 0; i < Other.m_NumArgs; ++i)
|
for(unsigned i = 0; i < Other.m_NumArgs; ++i)
|
||||||
m_apArgs[i] = Other.m_apArgs[i] + Offset;
|
m_apArgs[i] = m_aStringStorage+(Other.m_apArgs[i]-Other.m_aStringStorage);
|
||||||
}
|
}
|
||||||
return *this;
|
return *this;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue