vigna / fastutil

fastutil extends the Java™ Collections Framework by providing type-specific maps, sets, lists and queues.
Apache License 2.0
1.81k stars 199 forks source link

Fix error passing oversized array to PrimitiveImmutableList #325

Closed Ampflower closed 4 months ago

Ampflower commented 4 months ago

*ImmutableList for primitives can produce an ArrayIndexOutOfBoundsException via System.arraycopy due to using a.length rather than this.a.length or size() within context of the parameter being named a as well.

This also introduces testcases in IntImmutableListTest and IntArrayListTest to ensure that the check does not regress.