]> source.dussan.org Git - poi.git/commitdiff
Fix 1.6ism
authorNick Burch <nick@apache.org>
Tue, 21 Sep 2010 11:54:05 +0000 (11:54 +0000)
committerNick Burch <nick@apache.org>
Tue, 21 Sep 2010 11:54:05 +0000 (11:54 +0000)
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@999349 13f79535-47bb-0310-9956-ffa450edef68

src/java/org/apache/poi/poifs/filesystem/Ole10Native.java

index fcf61caa0f0ed9784d133d67c41323cc81e47408..488bfb3053867678cf57a717d4ae2a106c38dbea 100644 (file)
@@ -106,7 +106,10 @@ public class Ole10Native {
       dataBuffer = new byte[totalSize-4];\r
       System.arraycopy(data, 4, dataBuffer, 0, dataBuffer.length);\r
       dataSize = totalSize - 4;\r
-      label = "ole-"+ HexDump.toHex(Arrays.copyOf(dataBuffer, 8));\r
+      \r
+      byte[] oleLabel = new byte[8];\r
+      System.arraycopy(dataBuffer, 0, oleLabel, 0, Math.min(dataBuffer.length, 8));\r
+      label = "ole-"+ HexDump.toHex(oleLabel);\r
       fileName = label;\r
       command = label;\r
     } else {\r