aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2013-02-23 16:58:01 +0100
committerMichael Niedermayer <michaelni@gmx.at>2013-02-23 17:18:22 +0100
commit02ac3398eb52679301028c2fd3ebad1b6261b4da (patch)
tree18b4a87b2bc9fe6bc07de303c67c3d60b3bf1612
parentdf63e0c8bbf33160fe379033323570881171dab8 (diff)
downloadffmpeg-02ac3398eb52679301028c2fd3ebad1b6261b4da.tar.gz
rtmpproto: Check APP_MAX_LENGTH
Fixes Ticket2292 Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
-rw-r--r--libavformat/rtmpproto.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/libavformat/rtmpproto.c b/libavformat/rtmpproto.c
index 6f03dd9d7e..fa661ee552 100644
--- a/libavformat/rtmpproto.c
+++ b/libavformat/rtmpproto.c
@@ -2367,16 +2367,20 @@ reconnect:
fname = strchr(p + 1, '/');
if (!fname || (c && c < fname)) {
fname = p + 1;
- av_strlcpy(rt->app, path + 1, p - path);
+ av_strlcpy(rt->app, path + 1, FFMIN(p - path, APP_MAX_LENGTH));
} else {
fname++;
- av_strlcpy(rt->app, path + 1, fname - path - 1);
+ av_strlcpy(rt->app, path + 1, FFMIN(fname - path - 1, APP_MAX_LENGTH));
}
}
}
if (old_app) {
// The name of application has been defined by the user, override it.
+ if (strlen(old_app) >= APP_MAX_LENGTH) {
+ ret = AVERROR(EINVAL);
+ goto fail;
+ }
av_free(rt->app);
rt->app = old_app;
}