From 11097eb6215e623b1caefc31bd2c43eccb3897f3 Mon Sep 17 00:00:00 2001 From: OBattler Date: Wed, 15 Jan 2020 00:17:46 +0100 Subject: [PATCH] Added a sanity check to the XT ST-506 code. --- src/disk/hdc_st506_xt.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/disk/hdc_st506_xt.c b/src/disk/hdc_st506_xt.c index a49e866fe..5831fee88 100644 --- a/src/disk/hdc_st506_xt.c +++ b/src/disk/hdc_st506_xt.c @@ -1310,6 +1310,13 @@ loadrom(hdc_t *dev, const wchar_t *fn) uint32_t size; FILE *fp; + if (fn == NULL) { +#ifdef ENABLE_ST506_XT_LOG + st506_xt_log("ST506: NULL BIOS ROM file pointer!\n"); +#endif + return; + } + if ((fp = rom_fopen((wchar_t *) fn, L"rb")) == NULL) { st506_xt_log("ST506: BIOS ROM '%ls' not found!\n", fn); return;