diff mbox series

[FFmpeg-devel,2/3] avformat/ftp: Check for av_strtok() failure

Message ID 20210518213910.28732-2-michael@niedermayer.cc
State New
Headers show
Series [FFmpeg-devel,1/3] avfilter/avfiltergraph: Remove NULL checks after dereferences
Related show

Checks

Context Check Description
andriy/x86_make success Make finished
andriy/x86_make_fate success Make fate finished
andriy/PPC64_make success Make finished
andriy/PPC64_make_fate success Make fate finished

Commit Message

Michael Niedermayer May 18, 2021, 9:39 p.m. UTC
Fixes: CID1396258 Dereference null return value

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

Patch

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;