From 6761895ef563dfb1fa3729c54428e31138b7a58b Mon Sep 17 00:00:00 2001 From: divverent Date: Mon, 27 Jun 2011 14:05:26 +0000 Subject: [PATCH] prevent segfault caused by stringlistsort git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@11224 d7cf8633-e32d-0410-b094-e92efae38249 ::stable-branch::merge=e24277377e64376fe6a8bbbdfad73f614f3909bf --- filematch.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/filematch.c b/filematch.c index 42f9f9db..99711676 100644 --- a/filematch.c +++ b/filematch.c @@ -125,6 +125,8 @@ static int stringlistsort_cmp(const void *a, const void *b) void stringlistsort(stringlist_t *list, qboolean uniq) { int i, j; + if(list->numstrings < 1) + return; qsort(&list->strings[0], list->numstrings, sizeof(list->strings[0]), stringlistsort_cmp); if(uniq) { -- 2.39.2