You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@activemq.apache.org by "Miroslav Novak (JIRA)" <ji...@apache.org> on 2016/10/03 07:01:21 UTC
[jira] [Commented] (ARTEMIS-709) Possible NPE on
UUIDGenerator.getAllNetworkInterfaces()
[ https://issues.apache.org/jira/browse/ARTEMIS-709?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15541709#comment-15541709 ]
Miroslav Novak commented on ARTEMIS-709:
----------------------------------------
PR is merged, should this be resolved?
> 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)