diff mbox

[FFmpeg-devel,1/3] avformat/ftp: Fix Out-of-Bounds Access and Information Leak in ftp.c:393

Message ID 20190213093134.27979-1-michael@niedermayer.cc
State Accepted
Commit a142ffdcaec06fcbf7d4b00dbb0e5ddfb9e3344d
Headers show

Commit Message

Michael Niedermayer Feb. 13, 2019, 9:31 a.m. UTC
From: Wenxiang Qian <leonwxqian@qq.com>

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
---
 libavformat/ftp.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Michael Niedermayer Feb. 17, 2019, 8:41 a.m. UTC | #1
On Wed, Feb 13, 2019 at 10:31:32AM +0100, Michael Niedermayer wrote:
> From: Wenxiang Qian <leonwxqian@qq.com>
> 
> Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
> ---
>  libavformat/ftp.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)

will apply patchset

[...]
diff mbox

Patch

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;