From d8e9d19cf4684a98f9cebf168712b833d47348b0 Mon Sep 17 00:00:00 2001 From: OBattler Date: Wed, 15 Jan 2020 02:26:28 +0100 Subject: [PATCH] Added a sanity fatal() to the SST Flash code. --- src/sst_flash.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/sst_flash.c b/src/sst_flash.c index 5f0fc27f8..3dc151294 100644 --- a/src/sst_flash.c +++ b/src/sst_flash.c @@ -264,7 +264,8 @@ sst_39sf010_init(const device_t *info) f = nvr_fopen(flash_path, L"rb"); if (f) { - fread(&(dev->array[0x00000]), 0x20000, 1, f); + if (fread(&(dev->array[0x00000]), 1, 0x20000, f) != 0x20000) + fatal("Less than 131072 bytes read from the SST Flash ROM file\n"); fclose(f); }