From 7ed22bf33ba4967784e92cf74dc03f30bb6113ef Mon Sep 17 00:00:00 2001 From: Uwe Seimet Date: Wed, 15 Sep 2021 13:56:00 +0200 Subject: [PATCH] Updated file size validation --- 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 805f4db2..60df7830 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 || len & 0x1ff) { + if (len < 512 || len & 0x1ff) { ostringstream error; error << "Invalid image file size " << len; return ReturnStatus(fd, false, error.str());