From c775db50ef681eb97217306fd46af87e7676e564 Mon Sep 17 00:00:00 2001 From: Thomas Harte Date: Thu, 8 Jun 2017 21:31:03 -0400 Subject: [PATCH] Ensured no out-of-bounds accesses. --- Storage/Data/ZX8081.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Storage/Data/ZX8081.cpp b/Storage/Data/ZX8081.cpp index fb3a88638..f11de3b25 100644 --- a/Storage/Data/ZX8081.cpp +++ b/Storage/Data/ZX8081.cpp @@ -17,6 +17,8 @@ static uint16_t short_at(size_t address, const std::vector &data) { static std::shared_ptr ZX80FileFromData(const std::vector &data) { // Does this look like a ZX80 file? + if(data.size() < 0x28) return nullptr; + // uint16_t next_line_number = short_at(0x2, data); // uint16_t first_visible_line = short_at(0x13, data);