You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@pdfbox.apache.org by "Tilman Hausherr (JIRA)" <ji...@apache.org> on 2016/11/29 18:16:58 UTC

[jira] [Resolved] (PDFBOX-3605) Infinite Read Loop in BufferedRandomAccesssFile

     [ https://issues.apache.org/jira/browse/PDFBOX-3605?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Tilman Hausherr resolved PDFBOX-3605.
-------------------------------------
       Resolution: Fixed
         Assignee: Tilman Hausherr
    Fix Version/s: 2.1.0
                   2.0.4

Thank you for the excellent report!

> Infinite Read Loop in BufferedRandomAccesssFile
> -----------------------------------------------
>
>                 Key: PDFBOX-3605
>                 URL: https://issues.apache.org/jira/browse/PDFBOX-3605
>             Project: PDFBox
>          Issue Type: Bug
>          Components: FontBox
>    Affects Versions: 2.0.3
>            Reporter: Cameron Rollheiser
>            Assignee: Tilman Hausherr
>             Fix For: 2.0.4, 2.1.0
>
>
> When reading an input file using the BufferedRandomAccesssFile an infinite loop will occur once the buffer is drained and the value leftover becomes 0, since the read method will continue to return 0 as the -1 result from fillBuffer() is never propagated upstream and any code that is executing in a loop using -1 as an indicator that the file has been fully read will never exit.
> An example of where this occurs can be found here:
> https://github.com/apache/pdfbox/blob/782ac20dcea7b2e5bb6848f4da9a68c00b4d69a3/fontbox/src/main/java/org/apache/fontbox/ttf/TTFDataStream.java#L264



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@pdfbox.apache.org
For additional commands, e-mail: dev-help@pdfbox.apache.org