Issue #2672 Allow One extra null byte in RemoteRequestRouteWrapper.
Former-commit-id:3d08979eee
[formerly 7463bf7c3efbdf8eb184f24bfc9c6a12c57d5006] Former-commit-id:40bc9df420
This commit is contained in:
parent
733c21051c
commit
a0227d2c4e
1 changed files with 12 additions and 1 deletions
|
@ -67,7 +67,18 @@ public class RemoteRequestRouteWrapper {
|
||||||
Object obj = SerializationUtil.transformFromThrift(Object.class,
|
Object obj = SerializationUtil.transformFromThrift(Object.class,
|
||||||
data);
|
data);
|
||||||
int remaining = data.available();
|
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
|
throw new IllegalStateException(remaining
|
||||||
+ " unexpected bytes remaining after deserialization");
|
+ " unexpected bytes remaining after deserialization");
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue