From 3acbd0e2cae88e08583f13f53ec71a0e85b11f8d Mon Sep 17 00:00:00 2001 From: Timothe Litt Date: Fri, 5 Jul 2013 00:24:21 -0400 Subject: [PATCH] SCP: Prevent use of uninitialized pointer. --- scp.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/scp.c b/scp.c index 6d4830c8..a1be25a4 100644 --- a/scp.c +++ b/scp.c @@ -2526,7 +2526,7 @@ char gbuf[CBUFSIZE], *cvptr; DEVICE *dptr; UNIT *uptr; MTAB *mptr; -SHTAB *shtb, *shptr; +SHTAB *shtb = NULL, *shptr; static SHTAB show_glob_tab[] = { { "CONFIGURATION", &show_config, 0 }, @@ -2636,7 +2636,7 @@ while (*cptr != 0) { /* do all mods */ } /* end if */ } /* end for */ if (mptr->mask == 0) { /* no match? */ - if ((shptr = find_shtab (shtb, gbuf))) /* global match? */ + if (shtb && (shptr = find_shtab (shtb, gbuf))) /* global match? */ shptr->action (ofile, dptr, uptr, shptr->arg, cptr); else return SCPE_ARG; } /* end if */