From 492f332dd7ee470890b0018683de9fed41d3ee4d Mon Sep 17 00:00:00 2001 From: Uwe Seimet Date: Wed, 15 Sep 2021 11:31:52 +0200 Subject: [PATCH] Updated file size check --- src/raspberrypi/rascsi.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/raspberrypi/rascsi.cpp b/src/raspberrypi/rascsi.cpp index b3ef4262..c54bc620 100644 --- a/src/raspberrypi/rascsi.cpp +++ b/src/raspberrypi/rascsi.cpp @@ -728,7 +728,7 @@ bool CreateImage(int fd, const PbCommand& command) catch(const out_of_range& e) { return ReturnStatus(fd, false, "Invalid image file size " + command.params().Get(1)); } - if (len < 256) { + if (len < 256 || len & 0x1ff) { ostringstream error; error << "Invalid image file size " << len; return ReturnStatus(fd, false, error.str());