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

Nick Burch commented on TIKA-1388:
----------------------------------

Not sure how this is a Buffer Overflow? The buffer is increased in size as 
needed, so it's never possible to write past the end of it

Is this problem in the context of a specific parser or file? The likely fix may 
instead be in that parser, rather than in the IO Utils

> Tika IOUtils java.lang.OutOfMemoryError
> ---------------------------------------
>
>                 Key: TIKA-1388
>                 URL: https://issues.apache.org/jira/browse/TIKA-1388
>             Project: Tika
>          Issue Type: Bug
>            Reporter: Alejandro León Mora
>            Priority: Minor
>
> There is a possible Buffer Overflow error in IOUtils class buecause the 
> buffer is not limited. A Unitary test is present in 
> https://github.com/tutmosisII/TDDJNTikaOutOfMemoryError.
> The error generated has this stack trace:
> Requested array size exceeds VM limit
> java.lang.OutOfMemoryError
>       at java.util.Arrays.copyOf(Arrays.java:2271)
>       at java.io.ByteArrayOutputStream.grow(ByteArrayOutputStream.java:113)
>       at 
> java.io.ByteArrayOutputStream.ensureCapacity(ByteArrayOutputStream.java:93)
>       at java.io.ByteArrayOutputStream.write(ByteArrayOutputStream.java:140)
>       at org.apache.tika.io.IOUtils.copyLarge(IOUtils.java:934)
>       at org.apache.tika.io.IOUtils.copy(IOUtils.java:907)
>       at org.apache.tika.io.IOUtils.toByteArray(IOUtils.java:197)



--
This message was sent by Atlassian JIRA
(v6.2#6252)

Reply via email to