Uploaded image for project: 'Camel'
  1. Camel
  2. CAMEL-9862

Potential NPE in UndertowComponent.unregisterConsumer

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Minor
    • Resolution: Fixed
    • 2.16.3, 2.17.0
    • 2.16.4, 2.17.1, 2.18.0
    • camel-undertow
    • None
    • Unknown

    Description

      There's a potential NPE in the UndertowComponent class when Undertow consumers are stopped. Here's a snippet from the unregisterConsumer method:

          public void unregisterConsumer(UndertowConsumer consumer) {
              int port = consumer.getEndpoint().getHttpURI().getPort();
              if (serversRegistry.containsKey(port)) {
                  serversRegistry.get(port).unregisterConsumer(consumer);
              }
              if (serversRegistry.get(port).isEmpty()) {
                // stuff happens here
              }
          }
      

      If serversRegistry.containsKey returns false for the given port, then we should not be proceeding to call methods like isEmpty afterwards.

      Attachments

        Activity

          People

            davsclaus Claus Ibsen
            jamesnetherton James Netherton
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: