diff options
author | Michael Niedermayer <michaelni@gmx.at> | 2015-03-14 21:32:35 +0100 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2015-03-29 03:34:23 +0200 |
commit | 17e6d249b702b8b6aa3452c3deef5e2042fc0f23 (patch) | |
tree | 764fd33d936f85ae7288642cfffec1ec417ba5e6 | |
parent | e0975c31f1888d2b1b8ff21ec8c6c56fe1da9cdb (diff) | |
download | ffmpeg-17e6d249b702b8b6aa3452c3deef5e2042fc0f23.tar.gz |
avformat/mov: Disallow ".." in dref unless use_absolute_path is set
as this kind of allows to circumvent it to some extend.
We also could add a separate parameter or value to choose this
Found-by: ramiro
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 1e4d0498df6621143da1a550006ddc3526ad51cb)
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
-rw-r--r-- | libavformat/mov.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/libavformat/mov.c b/libavformat/mov.c index 7746cc197c..6b20a57d07 100644 --- a/libavformat/mov.c +++ b/libavformat/mov.c @@ -2395,6 +2395,9 @@ static int mov_open_dref(AVIOContext **pb, const char *src, MOVDref *ref, av_strlcat(filename, "../", sizeof(filename)); av_strlcat(filename, ref->path + l + 1, sizeof(filename)); + if (!use_absolute_path) + if(strstr(ref->path + l + 1, "..") || ref->nlvl_from > 1) + return AVERROR(ENOENT); if (strlen(filename) + 1 == sizeof(filename)) return AVERROR(ENOENT); |