Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 434972 - [terminal] ArrayIndexOutOfBoundsException when pasting text with CRLF
Summary: [terminal] ArrayIndexOutOfBoundsException when pasting text with CRLF
Status: RESOLVED FIXED
Alias: None
Product: TCF
Classification: Tools
Component: Target (show other bugs)
Version: 1.3   Edit
Hardware: PC Windows 7
: P3 normal (vote)
Target Milestone: 1.2   Edit
Assignee: Project Inbox CLA
QA Contact: Uwe Stieber CLA
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2014-05-15 10:43 EDT by Anton Leherbauer CLA
Modified: 2014-06-02 16:45 EDT (History)
2 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Anton Leherbauer CLA 2014-05-15 10:43:58 EDT
I pasted some text with CRLF line separators into the Terminal connected to a local process and got following exception.
Looking at InputStreamMonitor.write() the result of onWriteContentToStream() is actually ignored. Only the length of the modified byte array is taken into account leading to the AIIOB if the array got larger.

java.lang.ArrayIndexOutOfBoundsException: 57
	at org.eclipse.tcf.te.ui.terminals.streams.InputStreamMonitor.write(InputStreamMonitor.java:302)
	at java.io.OutputStream.write(Unknown Source)
	at org.eclipse.tm.internal.terminal.emulator.VT100TerminalControl.sendString(VT100TerminalControl.java:536)
	at org.eclipse.tm.internal.terminal.emulator.VT100TerminalControl.pasteString(VT100TerminalControl.java:285)
	at org.eclipse.tm.internal.terminal.emulator.VT100TerminalControl.paste(VT100TerminalControl.java:273)
	at org.eclipse.tm.internal.terminal.emulator.VT100TerminalControl.paste(VT100TerminalControl.java:258)
	at org.eclipse.tm.internal.terminal.control.actions.TerminalActionPaste.run(TerminalActionPaste.java:53)
[...]
Comment 1 Martin Oberhuber CLA 2014-05-15 11:03:59 EDT
CQ:WIND00-WB4-3514
Comment 3 Martin Oberhuber CLA 2014-06-02 16:45:12 EDT
The effect of the fix seems to be, that I cannot paste any text with embedded CRLF any more at all -- _nothing_ happens when I paste the following (_EVERYTHING_ until end of the comment) into the Windows local terminal:

echo "Start ISS for 'ISS (ball_diab_rh850)'
E:\WindRiver\diab0514\workbench-4\x86-win32\bin\windiss_server.exe -sTCP::61830 -tRH850 -TE:/WindRiver/diab0514/workspace/ball_diab_rh850/RH850ENwindissdiab/ball_diab_rh850/Debug/ball_diab_rh850.elf -i