Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
vlc
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
Commits
24b37f48
Commit
24b37f48
authored
Nov 02, 2014
by
Rémi Denis-Courmont
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
httpcookies: fix heap read overflow (fixes #12674)
Cc: Antti Ajanki <antti.ajanki@iki.fi>
parent
3d95e735
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
4 deletions
+10
-4
src/misc/httpcookies.c
src/misc/httpcookies.c
+10
-4
No files found.
src/misc/httpcookies.c
View file @
24b37f48
...
@@ -332,10 +332,16 @@ static bool cookie_domain_matches( const http_cookie_t * cookie, const char *hos
...
@@ -332,10 +332,16 @@ static bool cookie_domain_matches( const http_cookie_t * cookie, const char *hos
size_t
host_len
=
strlen
(
host
);
size_t
host_len
=
strlen
(
host
);
size_t
cookie_domain_len
=
strlen
(
cookie
->
psz_domain
);
size_t
cookie_domain_len
=
strlen
(
cookie
->
psz_domain
);
int
i
=
host_len
-
cookie_domain_len
;
bool
is_suffix
=
false
,
has_dot_before_suffix
=
false
;
bool
is_suffix
=
(
i
>
0
)
&&
vlc_ascii_strcasecmp
(
&
host
[
i
],
cookie
->
psz_domain
)
==
0
;
if
(
host_len
>
cookie_domain_len
)
bool
has_dot_before_suffix
=
host
[
i
-
1
]
==
'.'
;
{
size_t
i
=
host_len
-
cookie_domain_len
;
is_suffix
=
vlc_ascii_strcasecmp
(
&
host
[
i
],
cookie
->
psz_domain
)
==
0
;
has_dot_before_suffix
=
host
[
i
-
1
]
==
'.'
;
}
bool
host_is_ipv4
=
strspn
(
host
,
"0123456789."
)
==
host_len
;
bool
host_is_ipv4
=
strspn
(
host
,
"0123456789."
)
==
host_len
;
bool
host_is_ipv6
=
strchr
(
host
,
':'
)
!=
NULL
;
bool
host_is_ipv6
=
strchr
(
host
,
':'
)
!=
NULL
;
return
is_suffix
&&
has_dot_before_suffix
&&
return
is_suffix
&&
has_dot_before_suffix
&&
...
...
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