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

Potential NPE in GrpcStreamingExchangeForwarder

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 3.11.2, 3.12.0
    • Component/s: camel-grpc
    • Labels:
      None
    • Estimated Complexity:
      Unknown

      Description

      GrpcProducer.doStop() invokes shutdown() on the forwarder:

      https://github.com/apache/camel/blob/main/components/camel-grpc/src/main/java/org/apache/camel/component/grpc/GrpcProducer.java#L141

      If the GrpcStreamingExchangeForwarder has not receieved any any exchanges, then the streamObserver field will be null, and any refrence to it triggered in doCreateStream will result in a NullPointerException:

      https://github.com/apache/camel/blob/main/components/camel-grpc/src/main/java/org/apache/camel/component/grpc/client/GrpcStreamingExchangeForwarder.java#L92-L113

      If the streamObserver is null, then I don't see any need to run the logic in shutdown().

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                jamesnetherton James Netherton
                Reporter:
                jamesnetherton James Netherton
              • Votes:
                0 Vote for this issue
                Watchers:
                1 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: