From c698fd1932ee5e4799a640fe1573b2ce8187f90b Mon Sep 17 00:00:00 2001 From: Richard Freeman Date: Sun, 9 Dec 2012 09:02:07 -0500 Subject: [PATCH] Fix buffer overflow in prs1 importer. Signed-off-by: Richard Freeman --- SleepLib/loader_plugins/prs1_loader.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/SleepLib/loader_plugins/prs1_loader.cpp b/SleepLib/loader_plugins/prs1_loader.cpp index 6209c840..66d7c0a5 100644 --- a/SleepLib/loader_plugins/prs1_loader.cpp +++ b/SleepLib/loader_plugins/prs1_loader.cpp @@ -1186,6 +1186,12 @@ bool PRS1Loader::OpenFile(Machine *mach, QString filename) return false; qint64 filesize=f.size(); + + if (filesize>max_load_buffer_size) { + qWarning() << "Waveform too big, increase max_load_buffer_size in PRS1Loader sourcecode" << filename; + return false; + } + if (f.read((char *)m_buffer,filesize)