Browse Source

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

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
tags/n4.2
Wenxiang Qian Michael Niedermayer 7 years ago
parent
commit
a142ffdcae
1 changed files with 1 additions and 1 deletions
  1. +1
    -1
      libavformat/ftp.c

+ 1
- 1
libavformat/ftp.c View File

@@ -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;


Loading…
Cancel
Save