Fixed the Shuttle HOT-539 segmentation fault.

This commit is contained in:
OBattler
2021-06-04 02:46:41 +02:00
parent eef77b7c86
commit f870f3439c

View File

@@ -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,