From f870f3439ce5fa46ee5d27201889c6e3529ab4d4 Mon Sep 17 00:00:00 2001 From: OBattler Date: Fri, 4 Jun 2021 02:46:41 +0200 Subject: [PATCH] Fixed the Shuttle HOT-539 segmentation fault. --- src/game/gameport.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/game/gameport.c b/src/game/gameport.c index ce9e4b086..a3ebd3a99 100644 --- a/src/game/gameport.c +++ b/src/game/gameport.c @@ -331,9 +331,10 @@ gameport_remap(void *priv, uint16_t address) } else { /* Port at other addresses: add to bottom. */ other_dev = active_gameports; - while (other_dev->next) + while (other_dev && other_dev->next) other_dev = other_dev->next; - other_dev->next = dev; + if (other_dev) + other_dev->next = dev; } io_sethandler(dev->addr, dev->len,