Do not accept invalid octal character values (>= 0400). This also avoid possible buffer overflows (e.g. previously `tr -s '\400'' or similars lead to them). Index: str.c =================================================================== RCS file: /cvsroot/src/usr.bin/tr/str.c,v retrieving revision 1.29 diff -u -p -r1.29 str.c --- str.c 11 Aug 2013 01:54:35 -0000 1.29 +++ str.c 25 May 2018 20:03:42 -0000 @@ -417,6 +417,8 @@ backslash(STR *s) } if (cnt) { /* We saw digits, so return their value */ + if (val >= OOBCH) + errx(1, "Invalid octal character value"); return val; } if (ch == '\0') {