From 09899c18fa545f018213b4b78fd2148f32d08d94 Mon Sep 17 00:00:00 2001 From: "Howard M. Harte" Date: Sun, 22 Jan 2023 13:55:58 -0800 Subject: [PATCH] AltairZ80: 2SIO: Fix potential NULL pointer dereference. --- AltairZ80/s100_2sio.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/AltairZ80/s100_2sio.c b/AltairZ80/s100_2sio.c index 6c4ca125..89cacc1d 100644 --- a/AltairZ80/s100_2sio.c +++ b/AltairZ80/s100_2sio.c @@ -546,6 +546,10 @@ static t_stat m2sio_detach(UNIT *uptr) { M2SIO_CTX *xptr; + if (uptr->dptr == NULL) { + return SCPE_IERR; + } + sim_debug(VERBOSE_MSG, uptr->dptr, "detach.\n"); if (uptr->flags & UNIT_ATT) {