Skip to content

Commit b9c5997

Browse files
committed
Bug fix in UTF-8 fixup code
1 parent 38cbe97 commit b9c5997

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

doc.cpp

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1914,6 +1914,12 @@ CString strLine (lpszText, size);
19141914

19151915
c = *p;
19161916

1917+
// bail out of UTF-8 collection if a non-high order bit is found in the incoming stream
1918+
if (!(flags & NOTE_OR_COMMAND) &&
1919+
m_phase == HAVE_UTF8_CHARACTER &&
1920+
(c & 0x80) == 0)
1921+
OutputBadUTF8characters ();
1922+
19171923
// note that CR, LF, ESC and IAC can appear inside telnet negotiation now (version 4.48)
19181924
if (m_phase != HAVE_SB &&
19191925
m_phase != HAVE_SUBNEGOTIATION &&

0 commit comments

Comments
 (0)