From: divverent Date: Mon, 27 Jun 2011 14:05:26 +0000 (+0000) Subject: prevent segfault caused by stringlistsort X-Git-Tag: xonotic-v0.5.0~95 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=6761895ef563dfb1fa3729c54428e31138b7a58b;p=xonotic%2Fdarkplaces.git 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 --- 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) {