[ 
https://issues.apache.org/jira/browse/PDFBOX-2869?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14622615#comment-14622615
 ] 

ASF subversion and git services commented on PDFBOX-2869:
---------------------------------------------------------

Commit 1690292 from [~lehmi] in branch 'pdfbox/trunk'
[ https://svn.apache.org/r1690292 ]

PDFBOX-2869: avoid corruption as proposed by Jesse Long

> Corruption in ScratchFileBuffer
> -------------------------------
>
>                 Key: PDFBOX-2869
>                 URL: https://issues.apache.org/jira/browse/PDFBOX-2869
>             Project: PDFBox
>          Issue Type: Bug
>          Components: Parsing
>    Affects Versions: 2.0.0
>            Reporter: Jesse Long
>            Assignee: Andreas Lehmkühler
>         Attachments: PDFBOX-2869.patch
>
>
> Under some specific circumstances, ScratchFileBuffer can get corrupted when 
> reading.
> These circumstances are, when the completely written buffer length is a 
> multiple of 4080, and the read(byte[], int, int) method is used to read till 
> the end of the buffer.
> Each page contains 4080 bytes. The last 8 bytes are a pointer to the next 
> page. This next page pointer is only written if the next page is needed, not 
> if the page is full but no further pages are needed.
> The bug is in the read(byte[], int, int) method which, after reading all 
> bytes from a page, tries to move to the next page, regardless of whether or 
> not there is actually a next page.
> The read(byte[], int, int) method must be changed to only read the next page 
> pointer if the end of buffer is not reached.



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

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to