some newfangled gcc found these
array out-of-bounds references
--
/sys/src/cmd/eqn/main.c
main.c.orig:4,10 - /n/sources/patch/applied/old-n-buggy/main.c:4,10
char *version = "version Oct 24, 1991";
- char in[MAXLINE]; /* input buffer */
+ char in[MAXLINE+1]; /* input buffer */
int noeqn;
char *cmdname;
/sys/src/cmd/jpg/readgif.c
readgif.c.orig:351,358 - /n/sources/patch/applied/old-n-buggy/readgif.c:351,360
if(hsize>0 && Bread(h->fd, h->buf, hsize) != hsize)
giferror(h, extreaderr);
if(!hasdata){
- if(h->buf[hsize-1] != 0)
- giferror(h, "ReadGIF: bad extension format");
+ /*
+ * This code used to check h->buf[hsize-1] != 0
+ * and giferror if so, but if !hasdata, hsize == 0.
+ */
return;
}
/sys/src/cmd/tapefs/v6fs.c
v6fs.c.orig:85,91 - /n/sources/patch/applied/old-n-buggy/v6fs.c:85,91
continue;
f = iget(ino);
strncpy(name, dp->name, V6NAMELEN);
- name[V6NAMELEN+1] = '\0';
+ name[V6NAMELEN] = '\0';
f.name = name;
popfile(r, f);
}
/sys/src/cmd/tapefs/v10fs.c
v10fs.c.orig:90,96 - /n/sources/patch/applied/old-n-buggy/v10fs.c:90,96
continue;
f = iget(ino);
strncpy(name, dp->name, VNAMELEN);
- name[VNAMELEN+1] = '\0';
+ name[VNAMELEN] = '\0';
f.name = name;
popfile(r, f);
}
/sys/src/cmd/tapefs/32vfs.c
32vfs.c.orig:93,99 - /n/sources/patch/applied/old-n-buggy/32vfs.c:93,99
continue;
f = iget(ino);
strncpy(name, dp->name, VNAMELEN);
- name[VNAMELEN+1] = '\0';
+ name[VNAMELEN] = '\0';
f.name = name;
popfile(r, f);
}
/sys/src/cmd/troff/t10.c
t10.c.orig:77,83 - /n/sources/patch/applied/old-n-buggy/t10.c:77,83
ics = EM; /* insertion character space */
for (i = 0; i < (NTAB - 1) && DTAB * (i + 1) < TABMASK; i++)
tabtab[i] = DTAB * (i + 1);
- tabtab[NTAB] = 0;
+ tabtab[NTAB-1] = 0;
pl = 11 * INCH; /* paper length */
po = PO; /* page offset */
spacesz = SS;