aboutsummaryrefslogtreecommitdiffstats
path: root/lib/sisfilerecord.h
diff options
context:
space:
mode:
authorDaniel Brahneborg <basic@chello.se>2002-03-28 09:47:25 +0000
committerDaniel Brahneborg <basic@chello.se>2002-03-28 09:47:25 +0000
commit81e05de4391c11fad7faf9bc164f92e128a49d25 (patch)
treed69f635c5986154f4e629a8f16de42676ccbbf11 /lib/sisfilerecord.h
parent1d9b2e0e156f9a58bd642b9f9e8b2a08e768f5ed (diff)
downloadplptools-81e05de4391c11fad7faf9bc164f92e128a49d25.tar.gz
plptools-81e05de4391c11fad7faf9bc164f92e128a49d25.tar.bz2
plptools-81e05de4391c11fad7faf9bc164f92e128a49d25.zip
Some buffer overrun checks.
Removed the --force flag.
Diffstat (limited to 'lib/sisfilerecord.h')
-rw-r--r--lib/sisfilerecord.h15
1 files changed, 12 insertions, 3 deletions
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