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

albumenj pushed a commit to branch 3.3
in repository https://gitbox.apache.org/repos/asf/dubbo.git


The following commit(s) were added to refs/heads/3.3 by this push:
     new 22b3c29b08 Fix bytesToInt parse error (#13808)
22b3c29b08 is described below

commit 22b3c29b08073e66e23a5061d14c36358b80cb98
Author: Achilles <[email protected]>
AuthorDate: Fri Mar 1 14:23:54 2024 +0800

    Fix bytesToInt parse error (#13808)
    
    Co-authored-by: 陈浩宇 <[email protected]>
---
 .../dubbo/remoting/http12/message/LengthFieldStreamingDecoder.java      | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git 
a/dubbo-remoting/dubbo-remoting-http12/src/main/java/org/apache/dubbo/remoting/http12/message/LengthFieldStreamingDecoder.java
 
b/dubbo-remoting/dubbo-remoting-http12/src/main/java/org/apache/dubbo/remoting/http12/message/LengthFieldStreamingDecoder.java
index 8256419ad3..c401cfeacd 100644
--- 
a/dubbo-remoting/dubbo-remoting-http12/src/main/java/org/apache/dubbo/remoting/http12/message/LengthFieldStreamingDecoder.java
+++ 
b/dubbo-remoting/dubbo-remoting-http12/src/main/java/org/apache/dubbo/remoting/http12/message/LengthFieldStreamingDecoder.java
@@ -182,7 +182,7 @@ public class LengthFieldStreamingDecoder implements 
StreamingDecoder {
     }
 
     protected static int bytesToInt(byte[] bytes) {
-        return (bytes[0] << 24) & 0xFF | (bytes[1] << 16) & 0xFF | (bytes[2] 
<< 8) & 0xFF | (bytes[3]) & 0xFF;
+        return ((bytes[0] & 0xFF) << 24) | ((bytes[1] & 0xFF) << 16) | 
((bytes[2] & 0xFF) << 8) | (bytes[3]) & 0xFF;
     }
 
     private enum DecodeState {

Reply via email to