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