From 81e05de4391c11fad7faf9bc164f92e128a49d25 Mon Sep 17 00:00:00 2001 From: Daniel Brahneborg Date: Thu, 28 Mar 2002 09:47:25 +0000 Subject: Some buffer overrun checks. Removed the --force flag. --- lib/sisfilerecord.h | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) (limited to 'lib/sisfilerecord.h') diff --git a/lib/sisfilerecord.h b/lib/sisfilerecord.h index d0ccced..96a5f2a 100644 --- a/lib/sisfilerecord.h +++ b/lib/sisfilerecord.h @@ -50,9 +50,15 @@ public: uint8_t* getDestPtr() { - return &m_buf[m_destPtr]; + return m_destPtr < m_len ? &m_buf[m_destPtr] : 0; } + /** + * Return a pointer to the file data for the file for the specified + * language. + */ + uint8_t* getFilePtr(int fileNo); + void setMainDrive(char drive); /** @@ -90,18 +96,21 @@ public: uint32_t m_sourceLength; uint32_t m_sourcePtr; uint32_t m_destLength; - uint32_t m_destPtr; uint32_t* m_fileLengths; - uint32_t* m_filePtrs; private: + uint32_t m_destPtr; + uint32_t* m_filePtrs; + /** * The buffer we belong to. * Used for updating the destination file name. */ uint8_t* m_buf; + int m_len; + }; #endif -- cgit v1.2.3