Fix out of bounds array reference (off by 1) when validating a maximum line number on a multiplexer

This commit is contained in:
Mark Pizzolato 2013-04-16 11:46:48 -07:00
parent 8e858341f6
commit b36efe5226

View file

@ -1540,7 +1540,7 @@ while (*tptr) {
if (0 == MATCH_CMD (gbuf, "LINE")) {
if ((NULL == cptr) || ('\0' == *cptr))
return SCPE_ARG;
nextline = (int32) get_uint (cptr, 10, mp->lines, &r);
nextline = (int32) get_uint (cptr, 10, mp->lines-1, &r);
if ((r != SCPE_OK) || (mp->lines == 1))
return SCPE_ARG;
break;