1
0
mirror of https://github.com/FFmpeg/FFmpeg.git synced 2025-01-19 05:49:09 +02:00

avformat/ftp: Fix Out-of-Bounds Access and Information Leak in ftp.c:393

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit a142ffdcaec06fcbf7d4b00dbb0e5ddfb9e3344d)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
This commit is contained in:
Wenxiang Qian 2019-02-13 08:47:20 +01:00 committed by Michael Niedermayer
parent 4123064b5f
commit 7426a7c958

View File

@ -386,7 +386,7 @@ static int ftp_file_size(FTPContext *s)
static const int size_codes[] = {213, 0}; static const int size_codes[] = {213, 0};
snprintf(command, sizeof(command), "SIZE %s\r\n", s->path); snprintf(command, sizeof(command), "SIZE %s\r\n", s->path);
if (ftp_send_command(s, command, size_codes, &res) == 213 && res) { if (ftp_send_command(s, command, size_codes, &res) == 213 && res && strlen(res) > 4) {
s->filesize = strtoll(&res[4], NULL, 10); s->filesize = strtoll(&res[4], NULL, 10);
} else { } else {
s->filesize = -1; s->filesize = -1;