Reporting FRAME_SIZE_ERROR in case wrong frame lengths.
This commit is contained in:
parent
161bccda22
commit
168a8f7dbf
|
@ -87,7 +87,7 @@ public class DataBodyParser extends BodyParser
|
|||
loop = length == 0;
|
||||
if (length < 0)
|
||||
{
|
||||
return notifyConnectionFailure(ErrorCode.PROTOCOL_ERROR, "invalid_data_frame_padding");
|
||||
return notifyConnectionFailure(ErrorCode.FRAME_SIZE_ERROR, "invalid_data_frame_padding");
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
|
|
@ -69,7 +69,7 @@ public class GoAwayBodyParser extends BodyParser
|
|||
length -= 4;
|
||||
if (length <= 0)
|
||||
{
|
||||
return notifyConnectionFailure(ErrorCode.PROTOCOL_ERROR, "invalid_go_away_frame");
|
||||
return notifyConnectionFailure(ErrorCode.FRAME_SIZE_ERROR, "invalid_go_away_frame");
|
||||
}
|
||||
}
|
||||
else
|
||||
|
@ -87,7 +87,7 @@ public class GoAwayBodyParser extends BodyParser
|
|||
--length;
|
||||
if (cursor > 0 && length <= 0)
|
||||
{
|
||||
return notifyConnectionFailure(ErrorCode.PROTOCOL_ERROR, "invalid_go_away_frame");
|
||||
return notifyConnectionFailure(ErrorCode.FRAME_SIZE_ERROR, "invalid_go_away_frame");
|
||||
}
|
||||
if (cursor == 0)
|
||||
{
|
||||
|
@ -95,7 +95,7 @@ public class GoAwayBodyParser extends BodyParser
|
|||
state = State.ERROR;
|
||||
if (length == 0)
|
||||
{
|
||||
return notifyConnectionFailure(ErrorCode.PROTOCOL_ERROR, "invalid_go_away_frame");
|
||||
return notifyConnectionFailure(ErrorCode.FRAME_SIZE_ERROR, "invalid_go_away_frame");
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
@ -109,7 +109,7 @@ public class GoAwayBodyParser extends BodyParser
|
|||
length -= 4;
|
||||
if (length < 0)
|
||||
{
|
||||
return notifyConnectionFailure(ErrorCode.PROTOCOL_ERROR, "invalid_go_away_frame");
|
||||
return notifyConnectionFailure(ErrorCode.FRAME_SIZE_ERROR, "invalid_go_away_frame");
|
||||
}
|
||||
if (length == 0)
|
||||
{
|
||||
|
@ -131,7 +131,7 @@ public class GoAwayBodyParser extends BodyParser
|
|||
--length;
|
||||
if (cursor > 0 && length <= 0)
|
||||
{
|
||||
return notifyConnectionFailure(ErrorCode.PROTOCOL_ERROR, "invalid_go_away_frame");
|
||||
return notifyConnectionFailure(ErrorCode.FRAME_SIZE_ERROR, "invalid_go_away_frame");
|
||||
}
|
||||
if (cursor == 0)
|
||||
{
|
||||
|
|
|
@ -110,7 +110,7 @@ public class HeadersBodyParser extends BodyParser
|
|||
loop = length == 0;
|
||||
if (length < 0)
|
||||
{
|
||||
return notifyConnectionFailure(ErrorCode.PROTOCOL_ERROR, "invalid_headers_frame_padding");
|
||||
return notifyConnectionFailure(ErrorCode.FRAME_SIZE_ERROR, "invalid_headers_frame_padding");
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
@ -133,7 +133,7 @@ public class HeadersBodyParser extends BodyParser
|
|||
state = State.WEIGHT;
|
||||
if (length < 1)
|
||||
{
|
||||
return notifyConnectionFailure(ErrorCode.PROTOCOL_ERROR, "invalid_headers_frame");
|
||||
return notifyConnectionFailure(ErrorCode.FRAME_SIZE_ERROR, "invalid_headers_frame");
|
||||
}
|
||||
}
|
||||
else
|
||||
|
@ -151,7 +151,7 @@ public class HeadersBodyParser extends BodyParser
|
|||
--length;
|
||||
if (cursor > 0 && length <= 0)
|
||||
{
|
||||
return notifyConnectionFailure(ErrorCode.PROTOCOL_ERROR, "invalid_headers_frame");
|
||||
return notifyConnectionFailure(ErrorCode.FRAME_SIZE_ERROR, "invalid_headers_frame");
|
||||
}
|
||||
if (cursor == 0)
|
||||
{
|
||||
|
@ -159,7 +159,7 @@ public class HeadersBodyParser extends BodyParser
|
|||
state = State.WEIGHT;
|
||||
if (length < 1)
|
||||
{
|
||||
return notifyConnectionFailure(ErrorCode.PROTOCOL_ERROR, "invalid_headers_frame");
|
||||
return notifyConnectionFailure(ErrorCode.FRAME_SIZE_ERROR, "invalid_headers_frame");
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
|
|
@ -59,7 +59,7 @@ public class PriorityBodyParser extends BodyParser
|
|||
int length = getBodyLength();
|
||||
if (length != 5)
|
||||
{
|
||||
return notifyConnectionFailure(ErrorCode.PROTOCOL_ERROR, "invalid_priority_frame");
|
||||
return notifyConnectionFailure(ErrorCode.FRAME_SIZE_ERROR, "invalid_priority_frame");
|
||||
}
|
||||
state = State.EXCLUSIVE;
|
||||
break;
|
||||
|
|
|
@ -90,7 +90,7 @@ public class PushPromiseBodyParser extends BodyParser
|
|||
state = State.STREAM_ID;
|
||||
if (length < 4)
|
||||
{
|
||||
return notifyConnectionFailure(ErrorCode.PROTOCOL_ERROR, "invalid_push_promise_frame");
|
||||
return notifyConnectionFailure(ErrorCode.FRAME_SIZE_ERROR, "invalid_push_promise_frame");
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
@ -119,7 +119,7 @@ public class PushPromiseBodyParser extends BodyParser
|
|||
--length;
|
||||
if (cursor > 0 && length <= 0)
|
||||
{
|
||||
return notifyConnectionFailure(ErrorCode.PROTOCOL_ERROR, "invalid_push_promise_frame");
|
||||
return notifyConnectionFailure(ErrorCode.FRAME_SIZE_ERROR, "invalid_push_promise_frame");
|
||||
}
|
||||
if (cursor == 0)
|
||||
{
|
||||
|
|
|
@ -57,7 +57,7 @@ public class ResetBodyParser extends BodyParser
|
|||
int length = getBodyLength();
|
||||
if (length != 4)
|
||||
{
|
||||
return notifyConnectionFailure(ErrorCode.PROTOCOL_ERROR, "invalid_rst_stream_frame");
|
||||
return notifyConnectionFailure(ErrorCode.FRAME_SIZE_ERROR, "invalid_rst_stream_frame");
|
||||
}
|
||||
state = State.ERROR;
|
||||
break;
|
||||
|
|
|
@ -83,7 +83,7 @@ public class SettingsBodyParser extends BodyParser
|
|||
length -= 2;
|
||||
if (length <= 0)
|
||||
{
|
||||
return notifyConnectionFailure(ErrorCode.PROTOCOL_ERROR, "invalid_settings_frame");
|
||||
return notifyConnectionFailure(ErrorCode.FRAME_SIZE_ERROR, "invalid_settings_frame");
|
||||
}
|
||||
}
|
||||
else
|
||||
|
@ -102,7 +102,7 @@ public class SettingsBodyParser extends BodyParser
|
|||
--length;
|
||||
if (length <= 0)
|
||||
{
|
||||
return notifyConnectionFailure(ErrorCode.PROTOCOL_ERROR, "invalid_settings_frame");
|
||||
return notifyConnectionFailure(ErrorCode.FRAME_SIZE_ERROR, "invalid_settings_frame");
|
||||
}
|
||||
if (cursor == 0)
|
||||
{
|
||||
|
@ -139,7 +139,7 @@ public class SettingsBodyParser extends BodyParser
|
|||
--length;
|
||||
if (cursor > 0 && length <= 0)
|
||||
{
|
||||
return notifyConnectionFailure(ErrorCode.PROTOCOL_ERROR, "invalid_settings_frame");
|
||||
return notifyConnectionFailure(ErrorCode.FRAME_SIZE_ERROR, "invalid_settings_frame");
|
||||
}
|
||||
if (cursor == 0)
|
||||
{
|
||||
|
|
|
@ -52,7 +52,7 @@ public class WindowUpdateBodyParser extends BodyParser
|
|||
int length = getBodyLength();
|
||||
if (length != 4)
|
||||
{
|
||||
return notifyConnectionFailure(ErrorCode.PROTOCOL_ERROR, "invalid_window_update_frame");
|
||||
return notifyConnectionFailure(ErrorCode.FRAME_SIZE_ERROR, "invalid_window_update_frame");
|
||||
}
|
||||
state = State.WINDOW_DELTA;
|
||||
break;
|
||||
|
|
Loading…
Reference in New Issue