From: Nick Burch Date: Thu, 23 Aug 2007 12:03:20 +0000 (+0000) Subject: When trying to tell if a PPT file is encrypted or not, try to avoid an AIOOB X-Git-Tag: REL_3_0_2_BETA1~64 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=80cda31844ae238012a2eacb0a9429ec4202438c;p=poi.git When trying to tell if a PPT file is encrypted or not, try to avoid an AIOOB git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@568949 13f79535-47bb-0310-9956-ffa450edef68 --- diff --git a/src/scratchpad/src/org/apache/poi/hslf/EncryptedSlideShow.java b/src/scratchpad/src/org/apache/poi/hslf/EncryptedSlideShow.java index 2b92b848d2..15625fd2a8 100644 --- a/src/scratchpad/src/org/apache/poi/hslf/EncryptedSlideShow.java +++ b/src/scratchpad/src/org/apache/poi/hslf/EncryptedSlideShow.java @@ -91,10 +91,15 @@ public class EncryptedSlideShow } // Grab the details of the UserEditAtom there - Record r = Record.buildRecordAtOffset( - hss.getUnderlyingBytes(), - (int)cua.getCurrentEditOffset() - ); + // If the record's messed up, we could AIOOB + Record r = null; + try { + r = Record.buildRecordAtOffset( + hss.getUnderlyingBytes(), + (int)cua.getCurrentEditOffset() + ); + } catch(ArrayIndexOutOfBoundsException e) {} + if(r == null) { return null; } if(! (r instanceof UserEditAtom)) { return null; } UserEditAtom uea = (UserEditAtom)r;