You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@activemq.apache.org by "Martin Styk (JIRA)" <ji...@apache.org> on 2016/10/03 07:23:21 UTC
[jira] [Resolved] (ARTEMIS-709) Possible NPE on
UUIDGenerator.getAllNetworkInterfaces()
[ https://issues.apache.org/jira/browse/ARTEMIS-709?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Martin Styk resolved ARTEMIS-709.
---------------------------------
Resolution: Fixed
Fix Version/s: 1.4.0
Since PR is merged I am setting status to 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
> Fix For: 1.4.0
>
>
> 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)