From 8198bac1606efde2bc3e39e23b929b864b5c838c Mon Sep 17 00:00:00 2001 From: Peter Schorn Date: Thu, 30 Jan 2020 09:55:05 +0100 Subject: [PATCH] AltairZ80: Fix Coverity detected issues in s100_tarbell.c --- AltairZ80/s100_tarbell.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/AltairZ80/s100_tarbell.c b/AltairZ80/s100_tarbell.c index ffe18804..f77e7d87 100644 --- a/AltairZ80/s100_tarbell.c +++ b/AltairZ80/s100_tarbell.c @@ -417,6 +417,10 @@ t_stat tarbell_attach(UNIT *uptr, CONST char *cptr) } } + if (i >= TARBELL_MAX_DRIVES) { + return SCPE_ARG; + } + /* Default for new file is DSK */ uptr->u3 = IMAGE_TYPE_DSK; @@ -614,8 +618,6 @@ static uint8 TARBELL_Read(uint32 Addr) TARBELL_HeadLoad(uptr, pFD1771, TRUE); } else if (pFD1771->readTrkActive) { - cData = 0xe5; - /* If we reached the end of the track data, terminate command and set INTRQ */ if (pFD1771->trkCount == TARBELL_BYTES_PER_TRACK) { pFD1771->readTrkActive = FALSE;