poi-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From n...@apache.org
Subject svn commit: r568949 - /poi/trunk/src/scratchpad/src/org/apache/poi/hslf/EncryptedSlideShow.java
Date Thu, 23 Aug 2007 12:03:21 GMT
Author: nick
Date: Thu Aug 23 05:03:20 2007
New Revision: 568949

URL: http://svn.apache.org/viewvc?rev=568949&view=rev
Log:
When trying to tell if a PPT file is encrypted or not, try to avoid an AIOOB

Modified:
    poi/trunk/src/scratchpad/src/org/apache/poi/hslf/EncryptedSlideShow.java

Modified: poi/trunk/src/scratchpad/src/org/apache/poi/hslf/EncryptedSlideShow.java
URL: http://svn.apache.org/viewvc/poi/trunk/src/scratchpad/src/org/apache/poi/hslf/EncryptedSlideShow.java?rev=568949&r1=568948&r2=568949&view=diff
==============================================================================
--- poi/trunk/src/scratchpad/src/org/apache/poi/hslf/EncryptedSlideShow.java (original)
+++ poi/trunk/src/scratchpad/src/org/apache/poi/hslf/EncryptedSlideShow.java Thu Aug 23 05:03:20
2007
@@ -91,10 +91,15 @@
 			}
 			
 			// 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;
 			



---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@poi.apache.org
For additional commands, e-mail: commits-help@poi.apache.org


Mime
View raw message