]> git.xonotic.org Git - xonotic/darkplaces.git/blobdiff - common.c
critical fix for COM_FileBase (could go hunting through mem for /)
[xonotic/darkplaces.git] / common.c
index e31b48d7605b8d089bd2c87dc3d472e9806ce31f..e2b9c30524383b0efd4018d1c8b04c9793ba25fe 100644 (file)
--- a/common.c
+++ b/common.c
@@ -893,13 +893,15 @@ void COM_FileBase (char *in, char *out)
        while (s != in && *s != '.')
                s--;
        
-       for (s2 = s ; *s2 && *s2 != '/' ; s2--)
+       // LordHavoc: EWW bug bug bug bug bug... added previously missing s2 != in (yes, could go hunting through mem for /)
+       for (s2 = s ; s2 != in && *s2 && *s2 != '/' ; s2--)
        ;
        
        if (s-s2 < 2)
                strcpy (out,"?model?");
        else
        {
+               // LordHavoc: FIXME: examine this
                s--;
                strncpy (out,s2+1, s-s2);
                out[s-s2] = 0;