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
a66a1c28
Commit
a66a1c28
authored
Jan 18, 2008
by
Pierre d'Herbemont
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
access/http.c: More check on cookies we receive.
parent
3bc4a7f9
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
23 additions
and
6 deletions
+23
-6
modules/access/http.c
modules/access/http.c
+23
-6
No files found.
modules/access/http.c
View file @
a66a1c28
...
@@ -967,10 +967,13 @@ static int Request( access_t *p_access, int64_t i_tell )
...
@@ -967,10 +967,13 @@ static int Request( access_t *p_access, int64_t i_tell )
const
char
*
cookie
=
vlc_array_item_at_index
(
p_sys
->
cookies
,
i
);
const
char
*
cookie
=
vlc_array_item_at_index
(
p_sys
->
cookies
,
i
);
char
*
psz_cookie_content
=
cookie_get_content
(
cookie
);
char
*
psz_cookie_content
=
cookie_get_content
(
cookie
);
char
*
psz_cookie_domain
=
cookie_get_domain
(
cookie
);
char
*
psz_cookie_domain
=
cookie_get_domain
(
cookie
);
if
(
psz_cookie_content
&&
/* Check to see if we are in the right domain */
assert
(
psz_cookie_content
);
(
!
psz_cookie_domain
||
strstr
(
p_sys
->
url
.
psz_host
,
psz_cookie_domain
))
)
/* FIXME: This is clearly not conforming to the rfc */
vlc_bool_t
is_in_right_domain
=
(
!
psz_cookie_domain
||
strstr
(
p_sys
->
url
.
psz_host
,
psz_cookie_domain
));
if
(
is_in_right_domain
)
{
{
msg_Dbg
(
p_access
,
"Sending Cookie %s"
,
psz_cookie_content
);
msg_Dbg
(
p_access
,
"Sending Cookie %s"
,
psz_cookie_content
);
if
(
net_Printf
(
VLC_OBJECT
(
p_access
),
p_sys
->
fd
,
pvs
,
"Cookie: %s
\r\n
"
,
psz_cookie_content
)
<
0
)
if
(
net_Printf
(
VLC_OBJECT
(
p_access
),
p_sys
->
fd
,
pvs
,
"Cookie: %s
\r\n
"
,
psz_cookie_content
)
<
0
)
...
@@ -1337,15 +1340,29 @@ static char * cookie_get_name( const char * cookie )
...
@@ -1337,15 +1340,29 @@ static char * cookie_get_name( const char * cookie )
static
void
cookie_append
(
vlc_array_t
*
cookies
,
char
*
cookie
)
static
void
cookie_append
(
vlc_array_t
*
cookies
,
char
*
cookie
)
{
{
int
i
;
int
i
;
if
(
!
cookie
)
return
;
char
*
cookie_name
=
cookie_get_name
(
cookie
);
char
*
cookie_name
=
cookie_get_name
(
cookie
);
/* Don't send invalid cookies */
if
(
!
cookie_name
)
return
;
char
*
cookie_domain
=
cookie_get_domain
(
cookie
);
char
*
cookie_domain
=
cookie_get_domain
(
cookie
);
for
(
i
=
0
;
i
<
vlc_array_count
(
cookies
);
i
++
)
for
(
i
=
0
;
i
<
vlc_array_count
(
cookies
);
i
++
)
{
{
char
*
current_cookie
=
vlc_array_item_at_index
(
cookies
,
i
);
char
*
current_cookie
=
vlc_array_item_at_index
(
cookies
,
i
);
char
*
current_cookie_name
=
cookie_get_name
(
current_cookie
);
char
*
current_cookie_name
=
cookie_get_name
(
current_cookie
);
char
*
current_cookie_domain
=
cookie_get_domain
(
current_cookie
);
char
*
current_cookie_domain
=
cookie_get_domain
(
current_cookie
);
if
(
!
strcmp
(
cookie_name
,
current_cookie_name
)
&&
!
strcmp
(
cookie_domain
,
current_cookie_domain
))
assert
(
current_cookie_name
);
vlc_bool_t
is_domain_matching
=
(
cookie_domain
&&
current_cookie_domain
&&
!
strcmp
(
cookie_domain
,
current_cookie_domain
)
);
if
(
is_domain_matching
&&
!
strcmp
(
cookie_name
,
current_cookie_name
)
)
{
{
/* Remove previous value for this cookie */
/* Remove previous value for this cookie */
free
(
current_cookie
);
free
(
current_cookie
);
...
...
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