Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
vlc-2-2
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Redmine
Redmine
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Metrics
Environments
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
videolan
vlc-2-2
Commits
2e1b9e44
Commit
2e1b9e44
authored
Dec 11, 2010
by
Pierre Ynard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
httpd: gracefully handle too large request bodies
Return a 413 error instead of crashing
parent
8fae1e14
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
24 additions
and
1 deletion
+24
-1
src/network/httpd.c
src/network/httpd.c
+24
-1
No files found.
src/network/httpd.c
View file @
2e1b9e44
...
...
@@ -1832,8 +1832,31 @@ static void httpd_ClientRecv( httpd_client_t *cl )
/* TODO Mhh, handle the case where the client only
* sends a request and closes the connection to
* mark the end of the body (probably only RTSP) */
cl
->
query
.
p_body
=
x
malloc
(
cl
->
query
.
i_body
);
cl
->
query
.
p_body
=
malloc
(
cl
->
query
.
i_body
);
cl
->
i_buffer
=
0
;
if
(
cl
->
query
.
p_body
==
NULL
)
{
switch
(
cl
->
query
.
i_proto
)
{
case
HTTPD_PROTO_HTTP
:
{
const
uint8_t
sorry
[]
=
"HTTP/1.1 413 Request Entity Too Large
\r\n\r\n
"
;
httpd_NetSend
(
cl
,
sorry
,
sizeof
(
sorry
)
-
1
);
break
;
}
case
HTTPD_PROTO_RTSP
:
{
const
uint8_t
sorry
[]
=
"RTSP/1.0 413 Request Entity Too Large
\r\n\r\n
"
;
httpd_NetSend
(
cl
,
sorry
,
sizeof
(
sorry
)
-
1
);
break
;
}
default:
assert
(
0
);
}
i_len
=
0
;
/* drop */
}
break
;
}
else
...
...
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