Uploaded image for project: 'JBoss Enterprise Application Platform'
  1. JBoss Enterprise Application Platform
  2. JBEAP-5829

(7.0.z) ARTEMIS-709 - Possible NPE on UUIDGenerator.getAllNetworkInterfaces()

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Done
    • Icon: Minor Minor
    • 7.0.5.CR1, 7.0.5.GA
    • 7.0.1.CR2
    • ActiveMQ
    • None
    • EAP 7.0.5

      There is possibility of NPE on class UUIDGenerator in method getAllNetworkInterfaces().

         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();
            }
         }
      

      In case there are none network interfaces found on machine, method NetworkInterface.getNetworkInterfaces() returns null which can cause NPE in while cycle condition.

              rhn-support-ivassile Ilia Vassilev
              mstyk_jira Martin Styk (Inactive)
              Peter Mackay Peter Mackay
              Peter Mackay Peter Mackay
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

                Created:
                Updated:
                Resolved: