mirror of
https://github.com/ddnet/ddnet.git
synced 2024-11-09 09:38:19 +00:00
fifo: read() doesn't null-terminate!
valgrind found this with ChillerDragon's integration script extension
This commit is contained in:
parent
9a89e58a16
commit
735b0bdf4a
|
@ -61,9 +61,10 @@ void CFifo::Update()
|
|||
return;
|
||||
|
||||
char aBuf[8192];
|
||||
int Length = read(m_File, aBuf, sizeof(aBuf));
|
||||
int Length = read(m_File, aBuf, sizeof(aBuf) - 1);
|
||||
if(Length <= 0)
|
||||
return;
|
||||
aBuf[Length] = '\0';
|
||||
|
||||
char *pCur = aBuf;
|
||||
for(int i = 0; i < Length; ++i)
|
||||
|
|
Loading…
Reference in a new issue