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

(7.1.0) Possible NPE on UUIDGenerator.getAllNetworkInterfaces()

    XMLWordPrintable

Details

    • Bug
    • Resolution: Done
    • Minor
    • 7.1.0.DR7
    • 7.1.0.DR3
    • ActiveMQ
    • None

    Description

      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.

      Attachments

        Issue Links

          Activity

            People

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

              Dates

                Created:
                Updated:
                Resolved: