s3: Fix out of bounds array reference and string overflow warning

This commit is contained in:
Mark Pizzolato 2022-11-02 13:53:20 -10:00 committed by Paul Koning
parent 39d33c4cc9
commit 3bba1bbe14

View file

@ -272,7 +272,7 @@ int32 printf_sym (FILE *of, char *strg, t_addr addr, uint32 *val,
{
int32 c1, c2, group, len1, len2, inst, aaddr, baddr;
int32 oplen, groupno, i, j, vpos, qbyte, da, m, n;
char bld[128], bldaddr[96], boperand[32], aoperand[32];
char bld[128], bldaddr[160], boperand[32], aoperand[32];
int32 blk[16], blt[16];
int32 blkadd;
@ -575,7 +575,7 @@ switch (opcode[j].form) { /* Get operands based on
if (isdigit(gbuf[0])) {
sscanf(gbuf, "%x", &r);
} else {
for (i = 0; i < 16; i++) {
for (i = 0; i < 15; i++) {
if (strcmp(gbuf, regname[i]) == 0)
break;
}