aboutsummaryrefslogtreecommitdiffstats
path: root/src/input_file.c
diff options
context:
space:
mode:
authorMax Kellermann <max@duempel.org>2008-10-27 10:10:24 +0100
committerMax Kellermann <max@duempel.org>2008-10-27 10:10:24 +0100
commit0d30d51f07f1c55caf974c671fa702307c163878 (patch)
tree3d3c5cbb0a0ac122ce8308966cd093029a4b61cc /src/input_file.c
parent355108666c89bf2a637610b0f7a81974d1f312e4 (diff)
downloadmpd-0d30d51f07f1c55caf974c671fa702307c163878.tar.gz
mpd-0d30d51f07f1c55caf974c671fa702307c163878.tar.xz
mpd-0d30d51f07f1c55caf974c671fa702307c163878.zip
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.
Diffstat (limited to 'src/input_file.c')
-rw-r--r--src/input_file.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/input_file.c b/src/input_file.c
index eece19c53..8ffe11395 100644
--- a/src/input_file.c
+++ b/src/input_file.c
@@ -26,6 +26,9 @@ input_file_open(struct input_stream *is, const char *filename)
{
FILE *fp;
+ if (filename[0] != '/')
+ return false;
+
fp = fopen(filename, "r");
if (!fp) {
is->error = errno;