Added checks on the validity of the streamId.
This commit is contained in:
parent
7613385578
commit
907d303774
|
@ -62,6 +62,11 @@ public class DataBodyParser extends BodyParser
|
|||
{
|
||||
case PREPARE:
|
||||
{
|
||||
// SPEC: wrong streamId is treated as connection error.
|
||||
if (getStreamId() == 0)
|
||||
{
|
||||
return notifyConnectionFailure(ErrorCode.PROTOCOL_ERROR, "invalid_data_frame");
|
||||
}
|
||||
length = getBodyLength();
|
||||
if (isPaddingHigh())
|
||||
{
|
||||
|
|
|
@ -73,6 +73,11 @@ public class HeadersBodyParser extends BodyParser
|
|||
{
|
||||
case PREPARE:
|
||||
{
|
||||
// SPEC: wrong streamId is treated as connection error.
|
||||
if (getStreamId() == 0)
|
||||
{
|
||||
return notifyConnectionFailure(ErrorCode.PROTOCOL_ERROR, "invalid_headers_frame");
|
||||
}
|
||||
length = getBodyLength();
|
||||
if (isPaddingHigh())
|
||||
{
|
||||
|
|
|
@ -51,6 +51,11 @@ public class PriorityBodyParser extends BodyParser
|
|||
{
|
||||
case PREPARE:
|
||||
{
|
||||
// SPEC: wrong streamId is treated as connection error.
|
||||
if (getStreamId() == 0)
|
||||
{
|
||||
return notifyConnectionFailure(ErrorCode.PROTOCOL_ERROR, "invalid_priority_frame");
|
||||
}
|
||||
int length = getBodyLength();
|
||||
if (length != 5)
|
||||
{
|
||||
|
|
|
@ -49,6 +49,11 @@ public class ResetBodyParser extends BodyParser
|
|||
{
|
||||
case PREPARE:
|
||||
{
|
||||
// SPEC: wrong streamId is treated as connection error.
|
||||
if (getStreamId() == 0)
|
||||
{
|
||||
return notifyConnectionFailure(ErrorCode.PROTOCOL_ERROR, "invalid_rst_stream_frame");
|
||||
}
|
||||
int length = getBodyLength();
|
||||
if (length != 4)
|
||||
{
|
||||
|
|
|
@ -64,6 +64,11 @@ public class SettingsBodyParser extends BodyParser
|
|||
{
|
||||
case PREPARE:
|
||||
{
|
||||
// SPEC: wrong streamId is treated as connection error.
|
||||
if (getStreamId() != 0)
|
||||
{
|
||||
return notifyConnectionFailure(ErrorCode.PROTOCOL_ERROR, "invalid_settings_frame");
|
||||
}
|
||||
length = getBodyLength();
|
||||
settings = new HashMap<>();
|
||||
state = State.SETTING_ID;
|
||||
|
|
Loading…
Reference in New Issue