Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
vlc-1.1
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-1.1
Commits
d504b458
Commit
d504b458
authored
Mar 08, 2004
by
Gildas Bazin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
* src/misc/httpd.c: don't read past the end of our circular buffer in httpd_StreamCallBack().
parent
397bfc46
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
3 deletions
+12
-3
src/misc/httpd.c
src/misc/httpd.c
+12
-3
No files found.
src/misc/httpd.c
View file @
d504b458
...
@@ -597,7 +597,9 @@ struct httpd_stream_t
...
@@ -597,7 +597,9 @@ struct httpd_stream_t
int64_t
i_buffer_last_pos
;
/* a new connection will start with that */
int64_t
i_buffer_last_pos
;
/* a new connection will start with that */
};
};
static
int
httpd_StreamCallBack
(
httpd_callback_sys_t
*
p_sys
,
httpd_client_t
*
cl
,
httpd_message_t
*
answer
,
httpd_message_t
*
query
)
static
int
httpd_StreamCallBack
(
httpd_callback_sys_t
*
p_sys
,
httpd_client_t
*
cl
,
httpd_message_t
*
answer
,
httpd_message_t
*
query
)
{
{
httpd_stream_t
*
stream
=
(
httpd_stream_t
*
)
p_sys
;
httpd_stream_t
*
stream
=
(
httpd_stream_t
*
)
p_sys
;
...
@@ -610,14 +612,18 @@ static int httpd_StreamCallBack( httpd_callback_sys_t *p_sys, httpd_client_t *cl
...
@@ -610,14 +612,18 @@ static int httpd_StreamCallBack( httpd_callback_sys_t *p_sys, httpd_client_t *cl
int64_t
i_write
;
int64_t
i_write
;
int
i_pos
;
int
i_pos
;
/* fprintf( stderr, "httpd_StreamCallBack i_body_offset=%lld\n", answer->i_body_offset ); */
#if 0
fprintf( stderr, "httpd_StreamCallBack i_body_offset=%lld\n",
answer->i_body_offset );
#endif
if
(
answer
->
i_body_offset
>=
stream
->
i_buffer_pos
)
if
(
answer
->
i_body_offset
>=
stream
->
i_buffer_pos
)
{
{
/* fprintf( stderr, "httpd_StreamCallBack: no data\n" ); */
/* fprintf( stderr, "httpd_StreamCallBack: no data\n" ); */
return
VLC_EGENERIC
;
/* wait, no data available */
return
VLC_EGENERIC
;
/* wait, no data available */
}
}
if
(
answer
->
i_body_offset
+
stream
->
i_buffer_size
<
stream
->
i_buffer_pos
)
if
(
answer
->
i_body_offset
+
stream
->
i_buffer_size
<
stream
->
i_buffer_pos
)
{
{
/* this client isn't fast enough */
/* this client isn't fast enough */
fprintf
(
stderr
,
"fixing i_body_offset (old=%lld new=%lld)
\n
"
,
fprintf
(
stderr
,
"fixing i_body_offset (old=%lld new=%lld)
\n
"
,
...
@@ -636,6 +642,9 @@ static int httpd_StreamCallBack( httpd_callback_sys_t *p_sys, httpd_client_t *cl
...
@@ -636,6 +642,9 @@ static int httpd_StreamCallBack( httpd_callback_sys_t *p_sys, httpd_client_t *cl
return
VLC_EGENERIC
;
/* wait, no data available */
return
VLC_EGENERIC
;
/* wait, no data available */
}
}
/* Don't go past the end of the circular buffer */
i_write
=
__MIN
(
i_write
,
stream
->
i_buffer_size
-
i_pos
);
/* using HTTPD_MSG_ANSWER -> data available */
/* using HTTPD_MSG_ANSWER -> data available */
answer
->
i_proto
=
HTTPD_PROTO_HTTP
;
answer
->
i_proto
=
HTTPD_PROTO_HTTP
;
answer
->
i_version
=
0
;
answer
->
i_version
=
0
;
...
...
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