From c004fcc2ba013a9bba3305f6ebc0b3516d2f646e Mon Sep 17 00:00:00 2001 From: Mark Pizzolato Date: Sun, 11 Apr 2021 15:48:01 -0700 Subject: [PATCH] SCP: Fix Coverity identified issues --- scp.c | 2 +- sim_fio.c | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/scp.c b/scp.c index 62428a25..08069fd8 100644 --- a/scp.c +++ b/scp.c @@ -15730,7 +15730,7 @@ while (t->function_name) { if (*remainder != '\0') return sim_messagef (SCPE_IERR, "function: %s (\"\", gbuf, 0); returned a non empty string: \"%s\"\n", t->function_name, remainder); - while (*input) { + while ((input != NULL) && (*input != '\0')) { char end_char_string[32]; if (sim_isprint (d->end_char)) diff --git a/sim_fio.c b/sim_fio.c index f162bff8..e912e2de 100644 --- a/sim_fio.c +++ b/sim_fio.c @@ -332,6 +332,7 @@ if (((*file == '"') && (file[strlen (file) - 1] == '"')) || if (without_quotes == NULL) return NULL; if (SCPE_OK != sim_decode_quoted_string (file, without_quotes, &dsize)) { + free (without_quotes); errno = EINVAL; return NULL; }