zookeeper-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "lujie (JIRA)" <j...@apache.org>
Subject [jira] [Updated] (ZOOKEEPER-3008) Potential NPE in SaslQuorumAuthLearner#authenticate and SaslQuorumAuthServer#authenticate
Date Mon, 26 Mar 2018 07:44:00 GMT

     [ https://issues.apache.org/jira/browse/ZOOKEEPER-3008?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]

lujie updated ZOOKEEPER-3008:
-----------------------------
    Description: 
After ZK-3006 , I develop a very simple static analysis tool to find other Potential NPE
like ZK-3006, this bug is found by this tool and  carefully studied by myself, hopefully
someone can confirm it.
h2. Bug description:

callee :SecurityUtils#createSaslClient will return null while encounter exception
{code:java}
// code placeholder
catch (Exception e) {
  LOG.error("Exception while trying to create SASL client", e);
  return null;
}
{code}
but its caller has no null check just like:
{code:java}
// code placeholder
sc = SecurityUtils.createSaslClient();
if (sc.hasInitialResponse()) {
   responseToken = createSaslToken(new byte[0], sc, learnerLogin);
}
{code}
I think we should add null check while callee return null

  was:
After ZK-3006 , I develop a very simple static analysis tool to find other Potential NPE
like ZK-3006, this bug is found by this tool and  carefully studied by myself, hopefully
to be confirmed.
h2. Bug description:

callee :SecurityUtils#createSaslClient will return null while encounter exception
{code:java}
// code placeholder
catch (Exception e) {
  LOG.error("Exception while trying to create SASL client", e);
  return null;
}
{code}
but its caller has no null check just like:
{code:java}
// code placeholder
sc = SecurityUtils.createSaslClient();
if (sc.hasInitialResponse()) {
   responseToken = createSaslToken(new byte[0], sc, learnerLogin);
}
{code}
I think we should add null check while callee return null


> Potential NPE in SaslQuorumAuthLearner#authenticate and SaslQuorumAuthServer#authenticate
> -----------------------------------------------------------------------------------------
>
>                 Key: ZOOKEEPER-3008
>                 URL: https://issues.apache.org/jira/browse/ZOOKEEPER-3008
>             Project: ZooKeeper
>          Issue Type: Bug
>    Affects Versions: 3.6.0
>            Reporter: lujie
>            Priority: Major
>
> After ZK-3006 , I develop a very simple static analysis tool to find other Potential
NPE like ZK-3006, this bug is found by this tool and  carefully studied by myself, hopefully
someone can confirm it.
> h2. Bug description:
> callee :SecurityUtils#createSaslClient will return null while encounter exception
> {code:java}
> // code placeholder
> catch (Exception e) {
>   LOG.error("Exception while trying to create SASL client", e);
>   return null;
> }
> {code}
> but its caller has no null check just like:
> {code:java}
> // code placeholder
> sc = SecurityUtils.createSaslClient();
> if (sc.hasInitialResponse()) {
>    responseToken = createSaslToken(new byte[0], sc, learnerLogin);
> }
> {code}
> I think we should add null check while callee return null



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Mime
View raw message