summaryrefslogtreecommitdiff
path: root/libavformat/ftp.c
diff options
context:
space:
mode:
authorWenxiang Qian <leonwxqian@qq.com>2019-02-13 08:47:20 +0100
committerMichael Niedermayer <michael@niedermayer.cc>2019-02-17 10:29:42 +0100
commita142ffdcaec06fcbf7d4b00dbb0e5ddfb9e3344d (patch)
tree9b47a2f0f395630ea7ae8ec2c2aec5784699c0fe /libavformat/ftp.c
parent894995c41e0795c7a44f81adc4838dedc3932e65 (diff)
avformat/ftp: Fix Out-of-Bounds Access and Information Leak in ftp.c:393
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
Diffstat (limited to 'libavformat/ftp.c')
-rw-r--r--libavformat/ftp.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/libavformat/ftp.c b/libavformat/ftp.c
index e072067480..3adc04ee1f 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;