fifo: read() doesn't null-terminate!

valgrind found this with ChillerDragon's integration script extension
This commit is contained in:
def 2022-06-05 20:09:44 +02:00
parent 9a89e58a16
commit 735b0bdf4a

View file

@ -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)