avformat/ftp: Check for av_strtok() failure

Fixes: CID1396258 Dereference null return value

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit 9d40782088)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
This commit is contained in:
Michael Niedermayer 2021-05-18 22:38:40 +02:00
parent 5baa775675
commit 2104bed562
1 changed files with 2 additions and 0 deletions

View File

@ -949,6 +949,8 @@ static int ftp_parse_entry_mlsd(char *mlsd, AVIODirEntry *next)
continue; continue;
} }
fact = av_strtok(fact, "=", &value); fact = av_strtok(fact, "=", &value);
if (!fact)
continue;
if (!av_strcasecmp(fact, "type")) { if (!av_strcasecmp(fact, "type")) {
if (!av_strcasecmp(value, "cdir") || !av_strcasecmp(value, "pdir")) if (!av_strcasecmp(value, "cdir") || !av_strcasecmp(value, "pdir"))
return 1; return 1;