From 8c08a5399d5b5d3740cb4ffc58310d3e8aacfa02 Mon Sep 17 00:00:00 2001 From: Gregor Richards Date: Thu, 15 Dec 2016 16:19:54 -0500 Subject: [PATCH] Fix a possible NULL dereference in load_savestate In the unlikely situation that serial_info wasn't provided and the delta frame wasn't ready (possibly an impossible situation) it previously would have segfaulted. This fixes that. --- network/netplay/netplay.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/network/netplay/netplay.c b/network/netplay/netplay.c index a716b5b79b..f820dafea0 100644 --- a/network/netplay/netplay.c +++ b/network/netplay/netplay.c @@ -1575,6 +1575,11 @@ void netplay_load_savestate(netplay_t *netplay, } } } + else + { + /* FIXME: This is a critical failure! */ + return; + } } /* We need to ignore any intervening data from the other side,