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

ASF subversion and git services commented on ARTEMIS-709:
---------------------------------------------------------

Commit d5eaccf3ba8088c9308837a2e4173320d366038c in activemq-artemis's branch 
refs/heads/master from [~mstyk]
[ https://git-wip-us.apache.org/repos/asf?p=activemq-artemis.git;h=d5eaccf ]

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