Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
N
nghttp2
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Libraries
nghttp2
Commits
b0227d40
Commit
b0227d40
authored
Feb 04, 2016
by
Tatsuhiro Tsujikawa
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
nghttpd: Limit request header buffer
parent
28b643e5
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
11 additions
and
0 deletions
+11
-0
src/HttpServer.cc
src/HttpServer.cc
+8
-0
src/HttpServer.h
src/HttpServer.h
+3
-0
No files found.
src/HttpServer.cc
View file @
b0227d40
...
...
@@ -447,6 +447,7 @@ Stream::Stream(Http2Handler *handler, int32_t stream_id)
file_ent
(
nullptr
),
body_length
(
0
),
body_offset
(
0
),
header_buffer_size
(
0
),
stream_id
(
stream_id
),
echo_upload
(
false
)
{
auto
config
=
handler
->
get_config
();
...
...
@@ -1389,6 +1390,13 @@ int on_header_callback(nghttp2_session *session, const nghttp2_frame *frame,
return
0
;
}
if
(
stream
->
header_buffer_size
+
namelen
+
valuelen
>
64
_k
)
{
hd
->
submit_rst_stream
(
stream
,
NGHTTP2_INTERNAL_ERROR
);
return
0
;
}
stream
->
header_buffer_size
+=
namelen
+
valuelen
;
auto
token
=
http2
::
lookup_token
(
name
,
namelen
);
http2
::
index_header
(
stream
->
hdidx
,
token
,
stream
->
headers
.
size
());
...
...
src/HttpServer.h
View file @
b0227d40
...
...
@@ -119,6 +119,9 @@ struct Stream {
ev_timer
wtimer
;
int64_t
body_length
;
int64_t
body_offset
;
// Total amount of bytes (sum of name and value length) used in
// headers.
size_t
header_buffer_size
;
int32_t
stream_id
;
http2
::
HeaderIndex
hdidx
;
bool
echo_upload
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment