[ 
https://issues.apache.org/jira/browse/CURATOR-395?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15971498#comment-15971498
 ] 

ASF GitHub Bot commented on CURATOR-395:
----------------------------------------

GitHub user Randgalt opened a pull request:

    https://github.com/apache/curator/pull/213

    [CURATOR-395] Potential null dereference in PersistentNode

    localCreateMethod could be null in a race condition

You can merge this pull request into a Git repository by running:

    $ git pull https://github.com/apache/curator CURATOR-395

Alternatively you can review and apply these changes as the patch at:

    https://github.com/apache/curator/pull/213.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

    This closes #213
    
----
commit 302661a7af89d4101a9751acfa4897c45fcc44d9
Author: randgalt <[email protected]>
Date:   2017-04-17T18:58:15Z

    localCreateMethod could be null in a race condition

----


> Potential null dereference in PersistentNode
> --------------------------------------------
>
>                 Key: CURATOR-395
>                 URL: https://issues.apache.org/jira/browse/CURATOR-395
>             Project: Apache Curator
>          Issue Type: Bug
>            Reporter: Ted Yu
>            Assignee: Jordan Zimmerman
>            Priority: Minor
>
> {code}
>             if ( localCreateMethod == null )
>             {
>                 CreateModable<ACLBackgroundPathAndBytesable<String>> 
> tempCreateMethod = useProtection ? 
> client.create().creatingParentContainersIfNeeded().withProtection() : 
> client.create().creatingParentContainersIfNeeded();
>                 if ( createMethod.compareAndSet(null, tempCreateMethod) )
>                 {
>                     localCreateMethod = tempCreateMethod;
>                 }
>             }
>             localCreateMethod.withMode(getCreateMode(existingPath != 
> null)).inBackground(backgroundCallback).forPath(createPath, data.get());
> {code}
> Before calling withMode(), localCreateMethod should be checked against null.



--
This message was sent by Atlassian JIRA
(v6.3.15#6346)

Reply via email to