You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@eventmesh.apache.org by ma...@apache.org on 2022/10/26 13:27:18 UTC

[incubator-eventmesh] branch master updated: fix #1893: Possible null pointer dereference due to return value of called method [TcpMessageProtocolResolver]

This is an automated email from the ASF dual-hosted git repository.

majorhe pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-eventmesh.git


The following commit(s) were added to refs/heads/master by this push:
     new 6822d835 fix #1893: Possible null pointer dereference due to return value of called method [TcpMessageProtocolResolver]
     new f3229851 Merge pull request #1912 from darwindu/darwindu_issue_1893
6822d835 is described below

commit 6822d8350cb81c1652c32fceef3b873cb3b50fc0
Author: darwindu <25...@qq.com>
AuthorDate: Wed Oct 26 20:44:00 2022 +0800

    fix #1893:
    Possible null pointer dereference due to return value of called method
    [TcpMessageProtocolResolver]
---
 .../cloudevents/resolver/tcp/TcpMessageProtocolResolver.java         | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/eventmesh-protocol-plugin/eventmesh-protocol-cloudevents/src/main/java/org/apache/eventmesh/protocol/cloudevents/resolver/tcp/TcpMessageProtocolResolver.java b/eventmesh-protocol-plugin/eventmesh-protocol-cloudevents/src/main/java/org/apache/eventmesh/protocol/cloudevents/resolver/tcp/TcpMessageProtocolResolver.java
index 82b33888..3552dfe2 100644
--- a/eventmesh-protocol-plugin/eventmesh-protocol-cloudevents/src/main/java/org/apache/eventmesh/protocol/cloudevents/resolver/tcp/TcpMessageProtocolResolver.java
+++ b/eventmesh-protocol-plugin/eventmesh-protocol-cloudevents/src/main/java/org/apache/eventmesh/protocol/cloudevents/resolver/tcp/TcpMessageProtocolResolver.java
@@ -53,6 +53,11 @@ public class TcpMessageProtocolResolver {
                             protocolType, protocolVersion, protocolDesc));
         }
 
+        if (StringUtils.isBlank(cloudEventJson)) {
+            throw new ProtocolHandleException(
+                String.format("invalid method params cloudEventJson %s", cloudEventJson));
+        }
+
         if (!StringUtils.equals(CloudEventsProtocolConstant.PROTOCOL_NAME, protocolType)) {
             throw new ProtocolHandleException(String.format("Unsupported protocolType: %s", protocolType));
         }


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@eventmesh.apache.org
For additional commands, e-mail: commits-help@eventmesh.apache.org