SCP: Add more Error path checks
This commit is contained in:
parent
36f09d223f
commit
3989251f85
1 changed files with 5 additions and 1 deletions
6
scp.c
6
scp.c
|
@ -6153,7 +6153,10 @@ sim_switches &= ~(SWMASK ('F') | SWMASK ('D') | SWMASK ('Q')); /* remove digest
|
||||||
goto Cleanup_Return; \
|
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 */
|
READ_S (buf); /* [V2.5+] read version */
|
||||||
v40 = v35 = v32 = FALSE;
|
v40 = v35 = v32 = FALSE;
|
||||||
if (strcmp (buf, save_ver40) == 0) /* version 4.0? */
|
if (strcmp (buf, save_ver40) == 0) /* version 4.0? */
|
||||||
|
@ -8250,6 +8253,7 @@ while (size--) {
|
||||||
case '\'':
|
case '\'':
|
||||||
if (quote == *iptr)
|
if (quote == *iptr)
|
||||||
*tptr++ = '\\';
|
*tptr++ = '\\';
|
||||||
|
/* fall through */
|
||||||
default:
|
default:
|
||||||
if (sim_isprint (*iptr))
|
if (sim_isprint (*iptr))
|
||||||
*tptr++ = *iptr;
|
*tptr++ = *iptr;
|
||||||
|
|
Loading…
Add table
Reference in a new issue