[
https://issues.apache.org/jira/browse/MAPREDUCE-5748?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14550429#comment-14550429
]
Varun Saxena commented on MAPREDUCE-5748:
-----------------------------------------
[~devaraj.k], looked at it. I do not think null pointer dereference can occur
i.e. the newly added code which checks against {{mapIds.size()}} being 0 is not
possible. Even if map parameter is empty i.e. {{map=}}, {{String#split}} would
still return an array of strings with one element(which will be empty string).
So mapIds size would atleast be 1.
[~ted_yu], thoughts on this ?
We can however add a basic check for empty parameters because empty parameter
strings do not make any sense.
> Potential null pointer dereference in ShuffleHandler#Shuffle#messageReceived()
> ------------------------------------------------------------------------------
>
> Key: MAPREDUCE-5748
> URL: https://issues.apache.org/jira/browse/MAPREDUCE-5748
> Project: Hadoop Map/Reduce
> Issue Type: Bug
> Affects Versions: 2.7.0
> Reporter: Ted Yu
> Assignee: Varun Saxena
> Priority: Minor
> Labels: BB2015-05-RFC
> Attachments:
> 0001-MAPREDUCE-5748-Potential-null-pointer-deference-in-S.patch,
> MAPREDUCE-5748.02.patch, MAPREDUCE-5748.03.patch
>
>
> Starting around line 510:
> {code}
> ChannelFuture lastMap = null;
> for (String mapId : mapIds) {
> ...
> }
> lastMap.addListener(metrics);
> lastMap.addListener(ChannelFutureListener.CLOSE);
> {code}
> If mapIds is empty, lastMap would remain null, leading to NPE in
> addListener() call.
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)