From e5f1b22e16b32f36ca3a7af24cbda4f39bc861aa Mon Sep 17 00:00:00 2001
From: Liam <byteslice@airmail.cc>
Date: Mon, 19 Jun 2023 09:47:05 -0400
Subject: [PATCH] vfs_concat: verify short read

---
 src/core/file_sys/vfs_concat.cpp | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/src/core/file_sys/vfs_concat.cpp b/src/core/file_sys/vfs_concat.cpp
index 5285467d2..311a59e5f 100644
--- a/src/core/file_sys/vfs_concat.cpp
+++ b/src/core/file_sys/vfs_concat.cpp
@@ -168,6 +168,11 @@ std::size_t ConcatenatedVfsFile::Read(u8* data, std::size_t length, std::size_t
         cur_offset += actual_read_size;
         cur_length -= actual_read_size;
         it++;
+
+        // If we encountered a short read, we're done.
+        if (actual_read_size < intended_read_size) {
+            break;
+        }
     }
 
     return cur_offset - offset;