SCP: Add more Error path checks

This commit is contained in:
Mark Pizzolato 2017-03-28 13:40:11 -07:00
parent 36f09d223f
commit 3989251f85

6
scp.c
View file

@ -6153,7 +6153,10 @@ sim_switches &= ~(SWMASK ('F') | SWMASK ('D') | SWMASK ('Q')); /* remove digest
goto Cleanup_Return; \
}
fstat (fileno (rfile), &rstat);
if (fstat (fileno (rfile), &rstat)) {
r = SCPE_IOERR;
goto Cleanup_Return;
}
READ_S (buf); /* [V2.5+] read version */
v40 = v35 = v32 = FALSE;
if (strcmp (buf, save_ver40) == 0) /* version 4.0? */
@ -8250,6 +8253,7 @@ while (size--) {
case '\'':
if (quote == *iptr)
*tptr++ = '\\';
/* fall through */
default:
if (sim_isprint (*iptr))
*tptr++ = *iptr;