John Doe created HADOOP-15088:
---------------------------------

             Summary: BufferedInputStream.skip function can return 0 when the 
file is corrupted, causing an infinite loop
                 Key: HADOOP-15088
                 URL: https://issues.apache.org/jira/browse/HADOOP-15088
             Project: Hadoop Common
          Issue Type: Bug
          Components: streaming
    Affects Versions: 2.5.0
            Reporter: John Doe


When a file is corrupted, the skip function can return 0, causing an infinite 
loop.
Here is the code:

{code:java}
  private boolean slowReadUntilMatch(Pattern markPattern, boolean includePat,
                                     DataOutputBuffer outBufOrNull) throws 
IOException {
      ...
      for (long skiplen = endPos; skiplen > 0; ) {
        skiplen -= bin_.skip(skiplen); 
      }
      ...
  }
{code}




--
This message was sent by Atlassian JIRA
(v6.4.14#64029)

---------------------------------------------------------------------
To unsubscribe, e-mail: common-dev-unsubscr...@hadoop.apache.org
For additional commands, e-mail: common-dev-h...@hadoop.apache.org

Reply via email to