Add locale-independent control checks for security reason

This commit is contained in:
Andrey A. Chernov 1997-05-14 09:37:54 +00:00
parent 6ac1287d31
commit 01f6848c9c
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=25812

View File

@ -183,8 +183,10 @@ makemsg(fname)
putc('\r', fp);
putc('\n', fp);
cnt = 0;
} else if ( !isprint(ch) && !isspace(ch)
&& ch != '\007' && ch != '\010'
} else if ( ( (ch & 0x7F) < ' ' /* locale-independent */
|| (!isprint(ch) && !isspace(ch))
)
&& strchr("\a\f\t\v\b\r\n", ch) == NULL
) {
if (ch & 0x80) {
ch &= 0x7F;