From 36d64aaefbf7583249eb2e5519d5c421343d60da Mon Sep 17 00:00:00 2001 From: Yamagi Date: Mon, 19 Oct 2020 17:19:44 +0200 Subject: [PATCH] Check if FS_LIstFiles() returned NULL. This would have prevented the 7.44 release f*ckup. In practise this shoudl never happen, because there's always baseq2/ but you never know and it's better to be sure. --- src/common/filesystem.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/common/filesystem.c b/src/common/filesystem.c index 6599fa4f..bc08651b 100644 --- a/src/common/filesystem.c +++ b/src/common/filesystem.c @@ -1837,6 +1837,11 @@ FS_ListMods(int *nummods) dirchildren = FS_ListFiles(searchpath, &numdirchildren, 0, 0); + if (dirchildren == NULL) + { + continue; + } + // iterate over the children of this Raw path (unless we've already got enough mods) for (int i = 0; i < numdirchildren && nmods < MAX_MODS; i++) {