PDP10: Fixed word count test in EXE loader (COVERITY)

This commit is contained in:
Bob Supnik 2017-03-09 20:09:59 -08:00 committed by Mark Pizzolato
parent 706de798ba
commit 1e10080bc6

View file

@ -24,6 +24,7 @@
in this Software without prior written authorization from Robert M Supnik. in this Software without prior written authorization from Robert M Supnik.
09-Mar-17 RMS Added mask on EXE repeat count (COVERITY) 09-Mar-17 RMS Added mask on EXE repeat count (COVERITY)
Fixed word count test in EXE loader (COVERITY)
20-Jan-17 RMS Fixed RIM loader to handle ITS and RIM10B formats 20-Jan-17 RMS Fixed RIM loader to handle ITS and RIM10B formats
04-Apr-11 RMS Removed DEUNA/DELUA support - never implemented 04-Apr-11 RMS Removed DEUNA/DELUA support - never implemented
01-Feb-07 RMS Added CD support 01-Feb-07 RMS Added CD support
@ -328,7 +329,7 @@ do {
if (wc == 0) /* error? */ if (wc == 0) /* error? */
return SCPE_FMT; return SCPE_FMT;
bsz = (int32) ((data & RMASK) - 1); /* get count */ bsz = (int32) ((data & RMASK) - 1); /* get count */
if (bsz <= 0) /* zero? */ if (bsz < 0) /* zero? */
return SCPE_FMT; return SCPE_FMT;
bty = (int32) LRZ (data); /* get type */ bty = (int32) LRZ (data); /* get type */
switch (bty) { /* case type */ switch (bty) { /* case type */
@ -341,8 +342,8 @@ do {
return SCPE_FMT; return SCPE_FMT;
break; break;
case EXE_PDV: /* ??? */ case EXE_PDV: /* optional */
fseek (fileref, bsz * sizeof (d10), SEEK_CUR); fseek (fileref, bsz * sizeof (d10), SEEK_CUR); /* skip data */
break; break;
case EXE_VEC: /* entry vec */ case EXE_VEC: /* entry vec */