diff mbox series

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

Message ID 20210518213910.28732-2-michael@niedermayer.cc
State Accepted
Commit 9d40782088cf969fbadc881e4a97ec22b8ae0177
Headers show
Series [FFmpeg-devel,1/3] avfilter/avfiltergraph: Remove NULL checks after dereferences | expand

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(+)

Comments

Michael Niedermayer July 2, 2021, 7:42 p.m. UTC | #1
On Tue, May 18, 2021 at 11:39:09PM +0200, Michael Niedermayer wrote:
> Fixes: CID1396258 Dereference null return value
> 
> Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
> ---
>  libavformat/ftp.c | 2 ++
>  1 file changed, 2 insertions(+)

will apply

[...]
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;