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

Potential NPE in UndertowComponent.unregisterConsumer

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 2.16.3, 2.17.0
    • Fix Version/s: 2.16.4, 2.17.1, 2.18.0
    • Component/s: camel-undertow
    • Labels:
      None
    • Estimated Complexity:
      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

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

              Dates

              • Created:
                Updated:
                Resolved: