Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
M
mpd
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Иван Мажукин
mpd
Commits
0d30d51f
Commit
0d30d51f
authored
Oct 27, 2008
by
Max Kellermann
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
input_file, input_curl: check URL type before attempting to open
Don't attempt to open a HTTP URL as a local file, and don't send a local path to libcurl.
parent
35510866
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
6 additions
and
0 deletions
+6
-0
input_curl.c
src/input_curl.c
+3
-0
input_file.c
src/input_file.c
+3
-0
No files found.
src/input_curl.c
View file @
0d30d51f
...
@@ -473,6 +473,9 @@ input_curl_open(struct input_stream *is, const char *url)
...
@@ -473,6 +473,9 @@ input_curl_open(struct input_stream *is, const char *url)
struct
input_curl
*
c
;
struct
input_curl
*
c
;
bool
ret
;
bool
ret
;
if
(
strncmp
(
url
,
"http://"
,
7
)
!=
0
)
return
false
;
c
=
g_new0
(
struct
input_curl
,
1
);
c
=
g_new0
(
struct
input_curl
,
1
);
c
->
url
=
g_strdup
(
url
);
c
->
url
=
g_strdup
(
url
);
INIT_LIST_HEAD
(
&
c
->
buffers
);
INIT_LIST_HEAD
(
&
c
->
buffers
);
...
...
src/input_file.c
View file @
0d30d51f
...
@@ -26,6 +26,9 @@ input_file_open(struct input_stream *is, const char *filename)
...
@@ -26,6 +26,9 @@ input_file_open(struct input_stream *is, const char *filename)
{
{
FILE
*
fp
;
FILE
*
fp
;
if
(
filename
[
0
]
!=
'/'
)
return
false
;
fp
=
fopen
(
filename
,
"r"
);
fp
=
fopen
(
filename
,
"r"
);
if
(
!
fp
)
{
if
(
!
fp
)
{
is
->
error
=
errno
;
is
->
error
=
errno
;
...
...
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