From 1530c917b5032e4fd625d3dddfa2d09c107838de Mon Sep 17 00:00:00 2001 From: lordhavoc Date: Sun, 7 Jan 2001 16:49:54 +0000 Subject: [PATCH] critical fix for COM_FileBase (could go hunting through mem for /) git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@125 d7cf8633-e32d-0410-b094-e92efae38249 --- common.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/common.c b/common.c index e31b48d7..e2b9c305 100644 --- 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; -- 2.39.2