]> git.rm.cloudns.org Git - xonotic/darkplaces.git/commitdiff
prevent segfault caused by stringlistsort
authordivverent <divverent@d7cf8633-e32d-0410-b094-e92efae38249>
Mon, 27 Jun 2011 14:05:26 +0000 (14:05 +0000)
committerRudolf Polzer <divverent@xonotic.org>
Mon, 27 Jun 2011 14:18:00 +0000 (16:18 +0200)
git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@11224 d7cf8633-e32d-0410-b094-e92efae38249
::stable-branch::merge=e24277377e64376fe6a8bbbdfad73f614f3909bf

filematch.c

index 42f9f9dbcbeb8f3d0e31d64d6138a51112ddae9e..997116766de56c1bf599543a16cb69dc0d9dfa21 100644 (file)
@@ -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)
        {