poi-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From fannin...@apache.org
Subject svn commit: r1849127 - /poi/trunk/src/scratchpad/src/org/apache/poi/hemf/record/emf/HemfDraw.java
Date Mon, 17 Dec 2018 20:41:38 GMT
Author: fanningpj
Date: Mon Dec 17 20:41:38 2018
New Revision: 1849127

URL: http://svn.apache.org/viewvc?rev=1849127&view=rev
Log:
lgtm issues: potential index out of bounds exceptions

Modified:
    poi/trunk/src/scratchpad/src/org/apache/poi/hemf/record/emf/HemfDraw.java

Modified: poi/trunk/src/scratchpad/src/org/apache/poi/hemf/record/emf/HemfDraw.java
URL: http://svn.apache.org/viewvc/poi/trunk/src/scratchpad/src/org/apache/poi/hemf/record/emf/HemfDraw.java?rev=1849127&r1=1849126&r2=1849127&view=diff
==============================================================================
--- poi/trunk/src/scratchpad/src/org/apache/poi/hemf/record/emf/HemfDraw.java (original)
+++ poi/trunk/src/scratchpad/src/org/apache/poi/hemf/record/emf/HemfDraw.java Mon Dec 17 20:41:38
2018
@@ -783,6 +783,9 @@ public class HemfDraw {
                         int mode2 = leis.readUByte();
                         int mode3 = leis.readUByte();
                         assert(mode2 == 0x04 && (mode3 == 0x04 || mode3 == 0x05));
+                        if ((i + 2) > points.length) {
+                            throw new IllegalStateException("Points index causes index out
of bounds");
+                        }
                         poly.curveTo(
                             points[i].getX(), points[i].getY(),
                             points[i+1].getX(), points[i+1].getY(),



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


Mime
View raw message