mirror of
https://github.com/moparisthebest/spdylay
synced 2024-12-22 07:38:52 -05:00
Check frame length strictly for GOAWAY, RST_STREAM and PING.
This commit is contained in:
parent
122c619260
commit
b182179aca
@ -575,7 +575,7 @@ int spdylay_frame_unpack_ping(spdylay_ping *frame,
|
||||
const uint8_t *head, size_t headlen,
|
||||
const uint8_t *payload, size_t payloadlen)
|
||||
{
|
||||
if(payloadlen < 4) {
|
||||
if(payloadlen != 4) {
|
||||
return SPDYLAY_ERR_INVALID_FRAME;
|
||||
}
|
||||
spdylay_frame_unpack_ctrl_hd(&frame->hd, head);
|
||||
@ -602,7 +602,7 @@ int spdylay_frame_unpack_goaway(spdylay_goaway *frame,
|
||||
const uint8_t *head, size_t headlen,
|
||||
const uint8_t *payload, size_t payloadlen)
|
||||
{
|
||||
if(payloadlen < 4) {
|
||||
if(payloadlen != 4) {
|
||||
return SPDYLAY_ERR_INVALID_FRAME;
|
||||
}
|
||||
spdylay_frame_unpack_ctrl_hd(&frame->hd, head);
|
||||
@ -674,7 +674,7 @@ int spdylay_frame_unpack_rst_stream(spdylay_rst_stream *frame,
|
||||
const uint8_t *head, size_t headlen,
|
||||
const uint8_t *payload, size_t payloadlen)
|
||||
{
|
||||
if(payloadlen < 8) {
|
||||
if(payloadlen != 8) {
|
||||
return SPDYLAY_ERR_INVALID_FRAME;
|
||||
}
|
||||
spdylay_frame_unpack_ctrl_hd(&frame->hd, head);
|
||||
|
Loading…
Reference in New Issue
Block a user