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
59865335
Commit
59865335
authored
Dec 14, 2015
by
Rémi Denis-Courmont
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
https: validate header field name
parent
6faf9066
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
14 additions
and
0 deletions
+14
-0
modules/access/http/message.c
modules/access/http/message.c
+14
-0
No files found.
modules/access/http/message.c
View file @
59865335
...
...
@@ -47,9 +47,17 @@ struct vlc_http_msg
struct
vlc_http_stream
*
payload
;
};
static
bool
vlc_http_is_token
(
const
char
*
);
static
int
vlc_http_msg_vadd_header
(
struct
vlc_http_msg
*
m
,
const
char
*
name
,
const
char
*
fmt
,
va_list
ap
)
{
if
(
!
vlc_http_is_token
(
name
))
{
/* Not a valid field name, i.e. not an HTTP token */
errno
=
EINVAL
;
return
-
1
;
}
char
*
(
*
h
)[
2
]
=
realloc
(
m
->
headers
,
sizeof
(
char
*
[
2
])
*
(
m
->
count
+
1
));
if
(
unlikely
(
h
==
NULL
))
return
-
1
;
...
...
@@ -495,6 +503,12 @@ static size_t vlc_http_token_length(const char *str)
return
i
;
}
static
bool
vlc_http_is_token
(
const
char
*
str
)
{
size_t
len
=
vlc_http_token_length
(
str
);
return
len
>
0
&&
str
[
len
]
==
'\0'
;
}
static
size_t
vlc_http_comment_length
(
const
char
*
str
)
{
/* IETF RFC7230 §3.2.6 */
if
(
*
str
!=
'('
)
...
...
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