I have situation where I am using BufferedReader readLine()
to read data from a socket, but readline()
reads data until it finds new line character/ return carriage in the Data.
And if my data does not contain new line character then it will keep on reading the data until it finds a new line and an intruder can inject DOS attack.
And even socket can timeout.
I know one solution might be we need to restrict line size and read only some data, and append data to the buffer.
Is it optimal solution or i can do it in some other way?.
I can override BufferedReader and override readLine() method. Is it feasible solution?.