[FFmpeg-cvslog] avformat/ftp: Check for av_strtok() failure

Michael Niedermayer git at videolan.org
Wed Sep 8 22:42:57 EEST 2021


ffmpeg | branch: release/4.4 | Michael Niedermayer <michael at niedermayer.cc> | Tue May 18 22:38:40 2021 +0200| [35a2e713857723eeca3ba148d144c62b1c1b2d5f] | committer: Michael Niedermayer

avformat/ftp: Check for av_strtok() failure

Fixes: CID1396258 Dereference null return value

Signed-off-by: Michael Niedermayer <michael at niedermayer.cc>
(cherry picked from commit 9d40782088cf969fbadc881e4a97ec22b8ae0177)
Signed-off-by: Michael Niedermayer <michael at niedermayer.cc>

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=35a2e713857723eeca3ba148d144c62b1c1b2d5f
---

 libavformat/ftp.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/libavformat/ftp.c b/libavformat/ftp.c
index caeea42920..69caa7670c 100644
--- a/libavformat/ftp.c
+++ b/libavformat/ftp.c
@@ -972,6 +972,8 @@ static int ftp_parse_entry_mlsd(char *mlsd, AVIODirEntry *next)
             continue;
         }
         fact = av_strtok(fact, "=", &value);
+        if (!fact)
+            continue;
         if (!av_strcasecmp(fact, "type")) {
             if (!av_strcasecmp(value, "cdir") || !av_strcasecmp(value, "pdir"))
                 return 1;



More information about the ffmpeg-cvslog mailing list