From bb479e5010eed3b2c3f7ceeba04db3679cb079df Mon Sep 17 00:00:00 2001 From: Christian Speckner Date: Mon, 11 Oct 2021 17:46:47 +0200 Subject: [PATCH] Fix segfault on invalid PlusROM URL. --- src/emucore/PlusROM.cxx | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/src/emucore/PlusROM.cxx b/src/emucore/PlusROM.cxx index 3476dfd4c..5c93155ab 100644 --- a/src/emucore/PlusROM.cxx +++ b/src/emucore/PlusROM.cxx @@ -99,6 +99,22 @@ class PlusROMRequest { "application/octet-stream" ); + if (!response) { + ostringstream ss; + ss + << "PlusCart: request to " + << myDestination.host + << "/" + << myDestination.path + << ": failed --- bad URL"; + + Logger::error(ss.str()); + + myState = State::failed; + + return; + } + if (response->status != 200) { ostringstream ss; ss