CHYhave opened a new issue, #13809: URL: https://github.com/apache/dubbo/issues/13809
<!-- If you need to report a security issue please visit https://github.com/apache/dubbo/security/policy --> - [ ] I have searched the [issues](https://github.com/apache/dubbo/issues) of this repository and believe that this is not a duplicate. ### Environment * Dubbo version: 3.3 * Operating System version: Mac os * Java version: 17 ### Steps to reproduce this issue LengthFieldStreamingDecoder#bytesToInt方法先进行了移位才转换为int,导致负数情况下解析int错误 ` protected static int bytesToInt(byte[] bytes) { return (bytes[0] << 24) & 0xFF | (bytes[1] << 16) & 0xFF | (bytes[2] << 8) & 0xFF | (bytes[3]) & 0xFF; } ` ` public static void main(String[] args) { int intValue = 387; // 示例 int 值 byte[] byteArray = new byte[4]; byteArray[0] = (byte) (intValue >> 24); // 取 int 值的第一个字节 byteArray[1] = (byte) (intValue >> 16); // 取 int 值的第二个字节 byteArray[2] = (byte) (intValue >> 8); // 取 int 值的第三个字节 byteArray[3] = (byte) intValue; // 取 int 值的第四个字节 System.out.println(bytesToInt(byteArray) == intValue); // false } ` Pls. provide [GitHub address] to reproduce this issue. ### Expected Behavior `true` ### Actual Behavior `false` If there is an exception, please attach the exception trace: ``` Just put your stack trace here! ``` -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected] --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
