[
https://issues.apache.org/jira/browse/HADOOP-18471?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17611757#comment-17611757
]
FuzzingTeam commented on HADOOP-18471:
--------------------------------------
The method storeArray uses the 1st element of the input array ({*}K{*}{*}[]
items{*}) to get the class for the *stringifier* without checking for an empty
array, and hence, causes the exception to be thrown.
*Code snippet of where the AIOBE throws:*
{code:java}
public static <K> void storeArray(Configuration conf, K[] items,
String keyName) throws IOException {
DefaultStringifier<K> stringifier = new DefaultStringifier<K>(conf,
GenericsUtil.getClass(items[0])); //
<---- thrown here
...
} {code}
{*}Solution:{*}{*}{*}
*We propose adding null and empty checks for the input array.*
> An unhandled ArrayIndexOutOfBoundsException in
> DefaultStringifier.storeArray() if provided with an empty input
> --------------------------------------------------------------------------------------------------------------
>
> Key: HADOOP-18471
> URL: https://issues.apache.org/jira/browse/HADOOP-18471
> Project: Hadoop Common
> Issue Type: Bug
> Components: common, io
> Affects Versions: 3.3.4
> Reporter: FuzzingTeam
> Priority: Major
>
> The code throws an unhandled ArrayIndexOutOfBoundsException when method
> _storeArray_ of DefaultStringifier.java is called with an empty array as
> input.
--
This message was sent by Atlassian Jira
(v8.20.10#820010)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]