No null pointer to mem_copy in SendControlMsg

src/base/system.c:261:15: runtime error: null pointer passed as argument 2, which is declared to never be null
/usr/include/string.h:44:28: note: nonnull attribute specified here
    #0 0x565165b348dc in mem_copy /media/ddnet/src/base/system.c:261:2
    #1 0x565165aeb27d in CNetBase::SendControlMsg(NETSOCKET, NETADDR*, int, int, void const*, int, int, bool) /media/ddnet/src/engine/shared/network.cpp:313:2
    #2 0x565165aeeb4e in CNetConnection::SendControl(int, void const*, int) /media/ddnet/src/engine/shared/network_conn.cpp:169:2
    #3 0x565165af08c5 in CNetConnection::Feed(CNetPacketConstruct*, NETADDR*, int) /media/ddnet/src/engine/shared/network_conn.cpp:367:6
    #4 0x565165aec7d2 in CNetClient::Recv(CNetChunk*) /media/ddnet/src/engine/shared/network_client.cpp:94:174
    #5 0x565165c5d5ea in CClient::PumpNetwork() /media/ddnet/src/engine/client/client.cpp:2571:24
    #6 0x565165c67a71 in CClient::Update() /media/ddnet/src/engine/client/client.cpp:2856:2
    #7 0x565165c72f4e in CClient::Run() /media/ddnet/src/engine/client/client.cpp:3237:4
    #8 0x565165c94b7e in main /media/ddnet/src/engine/client/client.cpp:4341:11
    #9 0x7fba5af2c151 in __libc_start_main (/usr/lib/libc.so.6+0x28151)
    #10 0x5651659e1e0d in _start (/media/ddnet/DDNet+0x705e0d)
This commit is contained in:
def 2020-10-10 12:27:22 +02:00
parent 7e297aff59
commit e6b0283722

View file

@ -310,7 +310,8 @@ void CNetBase::SendControlMsg(NETSOCKET Socket, NETADDR *pAddr, int Ack, int Con
Construct.m_NumChunks = 0;
Construct.m_DataSize = 1 + ExtraSize;
Construct.m_aChunkData[0] = ControlMsg;
mem_copy(&Construct.m_aChunkData[1], pExtra, ExtraSize);
if(pExtra)
mem_copy(&Construct.m_aChunkData[1], pExtra, ExtraSize);
// send the control message
CNetBase::SendPacket(Socket, pAddr, &Construct, SecurityToken, Sixup, true);