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

Potential NPE in GrpcStreamingExchangeForwarder

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • None
    • 3.11.2, 3.12.0
    • camel-grpc
    • None
    • 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

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

              Dates

                Created:
                Updated:
                Resolved: