Issue #2672 Allow One extra null byte in RemoteRequestRouteWrapper.
Former-commit-id:6d4e5d79de
[formerly3bc210a1f1
] [formerly3d08979eee
] [formerly6d4e5d79de
[formerly3bc210a1f1
] [formerly3d08979eee
] [formerly40bc9df420
[formerly3d08979eee
[formerly 7463bf7c3efbdf8eb184f24bfc9c6a12c57d5006]]]] Former-commit-id:40bc9df420
Former-commit-id:aa9542cf3f
[formerly01c4ce8e29
] [formerly 889387acc295602e9c38f3f464ee1b9a2ae3734c [formerlya0227d2c4e
]] Former-commit-id: 5457b68aea0e7d4cfc4696bf658becb496aa5176 [formerly38c9773f38
] Former-commit-id:cf1d48f888
This commit is contained in:
parent
9e7286a9ef
commit
9d21df8d15
1 changed files with 12 additions and 1 deletions
|
@ -67,7 +67,18 @@ public class RemoteRequestRouteWrapper {
|
|||
Object obj = SerializationUtil.transformFromThrift(Object.class,
|
||||
data);
|
||||
int remaining = data.available();
|
||||
if (remaining > 0) {
|
||||
if (remaining == 1) {
|
||||
int tail = data.read();
|
||||
/*
|
||||
* When http proxies are being used there is a single null
|
||||
* character at the end of the message, no need to panic.
|
||||
*/
|
||||
if (tail != 0x00) {
|
||||
throw new IllegalStateException(
|
||||
"Unexpected byte remaining after deserialization: "
|
||||
+ tail);
|
||||
}
|
||||
} else if (remaining > 0) {
|
||||
throw new IllegalStateException(remaining
|
||||
+ " unexpected bytes remaining after deserialization");
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue