Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-4107821

BufferedReader.readLine(int maxlen) to limit maximum number of read characters

XMLWordPrintable

    • Icon: Enhancement Enhancement
    • Resolution: Won't Fix
    • Icon: P5 P5
    • None
    • 1.1.5
    • core-libs
    • generic
    • generic

      Name: tb29552 Date: 01/29/98


      Requested by:
      (company - Mobile Telephone Networks , email - ###@###.###)

      This would allow a programmer to read a line of text
      not more than a certain number of characters.

      Eg. reading a socket that does text IO (like SMTP)
      one wants to read a line but not more than a certain
      number of characters.

      To use readLine() as is would be convinient but opens
      such a socket reader to denial of service attacks
      when a client spams volumes of text to the socket
      with no new line characters. The BufferedReader
      will read all of the text and eventually run out
      of memory.

      (Review ID: 24018)
      ======================================================================

            iris Iris Clark
            tbell Tim Bell
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: