|Summary:||PlfLfo.add(LFO, LFOData) results in IOOBE|
|Product:||POI||Reporter:||Yaniv Kunda <yaniv>|
|Component:||HWPF||Assignee:||POI Developers List <dev>|
Description Yaniv Kunda 2014-09-04 09:23:10 UTC
The following code in the method will always result in a IOOBE: _rgLfo[_lfoMac + 1] = lfo; _rgLfoData[_lfoMac + 1] = lfoData; should be: _rgLfo[_lfoMac] = lfo; _rgLfoData[_lfoMac] = lfoData; Sadly, this code is only reachable from the external org.apache.poi.hwpf.HWPFDocument#registerList(HWPFList) method, and has no tests. Furthermore, org.apache.poi.hwpf.model.TestListTables has a single test which does nothing - it uses a fixture that causes the first "if" to essentially skip the test. I am not familiar with this object model, so I cannot provide a sensible test.
Comment 1 Dominik Stadler 2016-04-05 15:30:58 UTC
I cannot see the problem with the code, it first enlarges the array and then puts the element into the postion that was just newly created, so should not cause any Exception. Please reopen if you can provide a unit-test that shows how it causes an Exception here.
Comment 2 Dominik Stadler 2016-04-05 15:32:34 UTC
Oops, sorry, I was wrong, seems to be really broken, but not used anywhere at all.