Skip to content

Commit

Permalink
Reject Unicode non-characters.
Browse files Browse the repository at this point in the history
  • Loading branch information
kilobyte committed Jul 27, 2018
1 parent 669205b commit 601e497
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions libtty/tty.c
Expand Up @@ -363,6 +363,11 @@ export void tty_write(tty vt, const char *buf, int len)
continue;
}
}

if (c>0x10FFFF) // outside Unicode
c=0xFFFD;
else if ((c&0xFFFF)>=0xFFFE || c>=0xFDD0 && c<0xFDF0)
c=0xFFFD; // non-characters
}
else
{
Expand Down

0 comments on commit 601e497

Please sign in to comment.