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

ASF GitHub Bot commented on ARTEMIS-709:
----------------------------------------

GitHub user MartinStyk opened a pull request:

    https://github.com/apache/activemq-artemis/pull/744

    ARTEMIS-709 Possible NPE on UUIDGenerator.getAllNetworkInterfaces()

    

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

    $ git pull https://github.com/MartinStyk/activemq-artemis ARTEMIS-709

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

    https://github.com/apache/activemq-artemis/pull/744.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 #744
    
----
commit d5eaccf3ba8088c9308837a2e4173320d366038c
Author: Martin Styk <[email protected]>
Date:   2016-08-31T11:41:47Z

    ARTEMIS-709 Possible NPE on UUIDGenerator.getAllNetworkInterfaces()

----


> Possible NPE on UUIDGenerator.getAllNetworkInterfaces()
> -------------------------------------------------------
>
>                 Key: ARTEMIS-709
>                 URL: https://issues.apache.org/jira/browse/ARTEMIS-709
>             Project: ActiveMQ Artemis
>          Issue Type: Bug
>    Affects Versions: 1.4.0
>            Reporter: Martin Styk
>            Priority: Minor
>
> There is possibility of NPE on class {{UUIDGenerator}} in method 
> {{getAllNetworkInterfaces()}}. 
> {code:java}
>    private static List<NetworkInterface> getAllNetworkInterfaces() {
>       Enumeration<NetworkInterface> networkInterfaces;
>       try {
>          networkInterfaces = NetworkInterface.getNetworkInterfaces();
>          List<NetworkInterface> ifaces = new ArrayList<>();
>          while (networkInterfaces.hasMoreElements()) {
>             ifaces.add(networkInterfaces.nextElement());
>          }
>          return ifaces;
>       }
>       catch (SocketException e) {
>          return Collections.emptyList();
>       }
>    }
> {code}
> In case there are none network interfaces found on machine, method 
> {{NetworkInterface.getNetworkInterfaces()}} returns {{null}} which can cause 
> NPE in while cycle condition.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to