diff options
author | Wenxiang Qian <leonwxqian@qq.com> | 2019-02-13 08:47:20 +0100 |
---|---|---|
committer | Michael Niedermayer <michael@niedermayer.cc> | 2019-03-21 10:42:52 +0100 |
commit | 02518ba07fe6ec7295ac9f786965de72a02b6a4e (patch) | |
tree | a62b2bdb6c74cdb0af3d29a88e674b0652a198f7 | |
parent | 7dc5c930354c4339ce36a6cc4f2113c9cfd294f5 (diff) | |
download | ffmpeg-02518ba07fe6ec7295ac9f786965de72a02b6a4e.tar.gz |
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>
-rw-r--r-- | libavformat/ftp.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/libavformat/ftp.c b/libavformat/ftp.c index 35bfbd47ab..ba64abb429 100644 --- a/libavformat/ftp.c +++ b/libavformat/ftp.c @@ -389,7 +389,7 @@ static int ftp_file_size(FTPContext *s) static const int size_codes[] = {213, 0}; 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); } else { s->filesize = -1; |