https://issues.apache.org/bugzilla/show_bug.cgi?id=49323
Summary: LittleEndian throws ArrayIndexOutOfBoundle Exception
Product: POI
Version: 3.7-dev
Platform: PC
OS/Version: Windows XP
Status: NEW
Severity: normal
Priority: P2
Component: POI Overall
AssignedTo: [email protected]
ReportedBy: [email protected]
For methods in LittleEndian util class in org.apache.poi.util package, there is
no border check of getXXXX methods, for example:
getInt(byte[] data, int offset) method, if the offset is less then 0 or greater
then data.length-4, then there would be an ArrayIndexOutOfBound Exception
happens.
I was planning to fix it with adding a check in the beginning of the method,
but there is a test case named TestIntegerField are expecting the exception to
happen, so that made me confused, what the expect behavior in this case? In my
fix, I set the value to 0 in order to let the program run without an exception.
I would love to check in my fix with unit test, just not sure which one is the
expected behavior? Exception or Return 0.
Zhang Zhang
--
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]