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

Michael Niedermayer git at videolan.org
Sat Jul 3 19:13:23 EEST 2021


ffmpeg | branch: master | Michael Niedermayer <michael at niedermayer.cc> | Tue May 18 22:38:40 2021 +0200| [9d40782088cf969fbadc881e4a97ec22b8ae0177] | 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>

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

 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