summaryrefslogtreecommitdiff
path: root/libavformat
diff options
context:
space:
mode:
authorMartin Storsjö <martin@martin.st>2010-10-02 21:58:36 +0000
committerMartin Storsjö <martin@martin.st>2010-10-02 21:58:36 +0000
commit9d229ef9e6505f3780df9f7e6b362612b2d53875 (patch)
treed2a71915f16fa57e07575781c1d75e064957ea16 /libavformat
parent978a5ce82e56cd48e47766a16fd406c8bfbfba04 (diff)
applehttp: Handle a .. path segment in the base url
Originally committed as revision 25318 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'libavformat')
-rw-r--r--libavformat/applehttp.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/libavformat/applehttp.c b/libavformat/applehttp.c
index f8f1f39a3c..f2f583892d 100644
--- a/libavformat/applehttp.c
+++ b/libavformat/applehttp.c
@@ -104,6 +104,12 @@ static void make_absolute_url(char *buf, int size, const char *base,
while (av_strstart(rel, "../", NULL) && sep) {
sep[0] = '\0';
sep = strrchr(buf, '/');
+ /* If the next directory name to pop off is "..", break here */
+ if (!strcmp(sep ? &sep[1] : buf, "..")) {
+ /* Readd the slash we just removed */
+ av_strlcat(buf, "/", size);
+ break;
+ }
if (sep)
sep[1] = '\0';
else