[FFmpeg-devel] [PATCH 2/3] avformat/ftp: Check for av_strtok() failure
    Michael Niedermayer 
    michael at niedermayer.cc
       
    Wed May 19 00:39:09 EEST 2021
    
    
  
Fixes: CID1396258 Dereference null return value
Signed-off-by: Michael Niedermayer <michael at niedermayer.cc>
---
 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;
-- 
2.17.1
    
    
More information about the ffmpeg-devel
mailing list