[jboss-jira] [JBoss JIRA] (JGRP-2163) Potential NPE in TP.handleProbe
Zoltan Farkas (JIRA)
issues at jboss.org
Mon Mar 13 11:54:00 EDT 2017
[ https://issues.jboss.org/browse/JGRP-2163?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13377002#comment-13377002 ]
Zoltan Farkas commented on JGRP-2163:
-------------------------------------
Thank you, there is also another unnecessary null check at:
https://github.com/belaban/JGroups/blob/3.6/src/org/jgroups/protocols/TP.java#L2282
where cluster_name cannot be null...
(I am chasing a NPE :
JGRP000029: XXXXXXX-48924: failed sending message to XXXXXXXX (125 bytes): java.lang.NullPointerException, headers: TCPPING: [type=GET_MBRS_REQ, cluster=XXXXXXXXX], TP: [cluster_name=XXXXXXXXXX]}
Unfortunately the exception details are not being logged....)
> Potential NPE in TP.handleProbe
> -------------------------------
>
> Key: JGRP-2163
> URL: https://issues.jboss.org/browse/JGRP-2163
> Project: JGroups
> Issue Type: Bug
> Reporter: Zoltan Farkas
> Assignee: Bela Ban
> Priority: Minor
> Fix For: 3.6.14
>
>
> at:
> https://github.com/belaban/JGroups/blob/3.6/src/org/jgroups/protocols/TP.java#L1398
> {code}
> public Map<String, String> handleProbe(String... keys) {
> Map<String,String> retval=new HashMap<>(keys != null? keys.length : 2);
> for(String key: keys) {
> {code}
> keys is checked for null and on the next line it is de-refferenced...
> this code fill fail with NPE if keys is null...
> This issue is discovered by findbugs NP_NULL_ON_SOME_PATH check. Highly recommend running findbugs + coverity (free for OS projects).
--
This message was sent by Atlassian JIRA
(v7.2.3#72005)
More information about the jboss-jira
mailing list