mirror of https://git.ffmpeg.org/ffmpeg.git
avformat/rtmpproto: add FFMIN() to av_strlcpy()
Suggested-by: Reimar Döffinger <Reimar.Doeffinger@gmx.de> Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
This commit is contained in:
parent
aff352be63
commit
0c2a6dabce
|
@ -2482,12 +2482,12 @@ reconnect:
|
||||||
if (qmark && strstr(qmark, "slist=")) {
|
if (qmark && strstr(qmark, "slist=")) {
|
||||||
char* amp;
|
char* amp;
|
||||||
// After slist we have the playpath, before the params, the app
|
// After slist we have the playpath, before the params, the app
|
||||||
av_strlcpy(rt->app, path + 1, qmark - path);
|
av_strlcpy(rt->app, path + 1, FFMIN(qmark - path, APP_MAX_LENGTH));
|
||||||
fname = strstr(path, "slist=") + 6;
|
fname = strstr(path, "slist=") + 6;
|
||||||
// Strip any further query parameters from fname
|
// Strip any further query parameters from fname
|
||||||
amp = strchr(fname, '&');
|
amp = strchr(fname, '&');
|
||||||
if (amp) {
|
if (amp) {
|
||||||
av_strlcpy(fname_buffer, fname, amp - fname + 1);
|
av_strlcpy(fname_buffer, fname, FFMIN(amp - fname + 1, sizeof(fname_buffer)));
|
||||||
fname = fname_buffer;
|
fname = fname_buffer;
|
||||||
}
|
}
|
||||||
} else if (!strncmp(path, "/ondemand/", 10)) {
|
} else if (!strncmp(path, "/ondemand/", 10)) {
|
||||||
|
|
Loading…
Reference in New Issue