Commit 02ac3398 authored by Michael Niedermayer's avatar Michael Niedermayer

rtmpproto: Check APP_MAX_LENGTH

Fixes Ticket2292
Signed-off-by: 's avatarMichael Niedermayer <michaelni@gmx.at>
parent df63e0c8
...@@ -2367,16 +2367,20 @@ reconnect: ...@@ -2367,16 +2367,20 @@ reconnect:
fname = strchr(p + 1, '/'); fname = strchr(p + 1, '/');
if (!fname || (c && c < fname)) { if (!fname || (c && c < fname)) {
fname = p + 1; fname = p + 1;
av_strlcpy(rt->app, path + 1, p - path); av_strlcpy(rt->app, path + 1, FFMIN(p - path, APP_MAX_LENGTH));
} else { } else {
fname++; 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) { if (old_app) {
// The name of application has been defined by the user, override it. // 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); av_free(rt->app);
rt->app = old_app; rt->app = old_app;
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment