[Konsole-devel] [Bug 114535] Using jis7 encoding causes the entire Konsole to freeze.

Thiago Macieira thiago at kde.org
Tue Oct 25 00:58:40 UTC 2005


------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.
         
http://bugs.kde.org/show_bug.cgi?id=114535         




------- Additional Comments From thiago kde org  2005-10-25 02:58 -------
Bug in the code, but I don't know whose fault it is.

297     void TEmulation::onRcvBlock(const char *s, int len)
298     {
299       emit notifySessionState(NOTIFYACTIVITY);
300
301       bulkStart();
302       for (int i = 0; i < len; i++)
303       {
304
305         QString result = decoder->toUnicode(&s[i],1);
306         int reslen = result.length();
307
308         // If we get a control code halfway a multi-byte sequence
309         // we flush the decoder and continue with the control code.
310         if ((s[i] < 32) && (s[i] > 0))
311         {
312            // Flush decoder
313            while(!result.length())
314               result = decoder->toUnicode(&s[i],1);
315            reslen = 1;
316            result.setLength(reslen);
317            result[0] = QChar(s[i]);
318         }

decoder is of type QJisDecoder.

The problem is that:
1) decoder is in state "esc"
2) decoder->toUnicode("\033",1) returns an empty QString
3) the loop in lines 313 and 314 is infinite if the decoder returns an empty string.

Maybe an increment on i was forgotten on the 313-314 loop?



More information about the konsole-devel mailing list