You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@kafka.apache.org by "lujie (JIRA)" <ji...@apache.org> on 2018/05/13 10:07:00 UTC
[jira] [Created] (KAFKA-6899) An Potential NPE
lujie created KAFKA-6899:
----------------------------
Summary: An Potential NPE
Key: KAFKA-6899
URL: https://issues.apache.org/jira/browse/KAFKA-6899
Project: Kafka
Issue Type: Bug
Reporter: lujie
We have developed a static analysis tool [NPEDetector|https://github.com/lujiefsi/NPEDetector] to find some potential NPE. Our analysis shows that some callees may return null in corner case(e.g. node crash , IO exception), some of their callers have _!=null_ check but some do not have.
*Bug:*
callee JaasConfig#getAppConfigurationEntry can return null, it has 13 callers, 11 of the callers have the null checker while using the return value, 2 of them have no checker :
{code:java}
//caller1:KerberosLogin#login(Stirng, callback)
AppConfigurationEntry entries[] = Configuration.getConfiguration().getAppConfigurationEntry(loginContextName);
for (AppConfigurationEntry entry: entries) {}//may NPE
//caller2:KerberosLogin#login()
AppConfigurationEntry[] entries = configuration().getAppConfigurationEntry(contextName());
if (entries.length == 0)/may NPE
{code}
I am not sure these two are bug o or not, please correct me without any without any hesitation.
--
This message was sent by Atlassian JIRA
(v7.6.3#76005)