vigna / fastutil

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

Fix error passing oversized array to PrimitiveImmutableList #325

Closed Ampflower closed 1 month ago

Ampflower commented 1 month 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.