From 0fc21ce746467b9f023f182b034ae754c5c5edee Mon Sep 17 00:00:00 2001 From: Glenn Maynard Date: Fri, 25 Jun 2004 18:30:33 +0000 Subject: [PATCH] fix buffer overflow --- stepmania/src/RageFile.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/stepmania/src/RageFile.cpp b/stepmania/src/RageFile.cpp index 29811f86aa..a7f1110136 100644 --- a/stepmania/src/RageFile.cpp +++ b/stepmania/src/RageFile.cpp @@ -96,7 +96,7 @@ int RageFile::FillBuf() /* The buffer starts at m_Buffer; any data in it starts at m_pBuf; space between * the two is old data that we've read. (Don't mangle that data; we can use it * for seeking backwards.) */ - const int iBufAvail = sizeof(m_Buffer) - (m_pBuf-m_Buffer); + const int iBufAvail = sizeof(m_Buffer) - (m_pBuf-m_Buffer) - m_BufAvail; ASSERT_M( iBufAvail >= 0, ssprintf("%p, %p, %i", m_pBuf, m_Buffer, (int) sizeof(m_Buffer) ) ); const int size = m_File->Read( m_pBuf+m_BufAvail, iBufAvail );