mirror of
https://github.com/nzp-team/fteqw.git
synced 2025-02-01 05:00:46 +00:00
Check bounds before, not after.
git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@3297 fc73d0e0-1445-4013-8a0c-d673dee63da5
This commit is contained in:
parent
db97dd67d0
commit
ccf1338d41
1 changed files with 1 additions and 4 deletions
|
@ -1576,12 +1576,9 @@ void COM_FileBase (const char *in, char *out, int outlen)
|
|||
while (s > in && *s != '.')
|
||||
s--;
|
||||
|
||||
for (s2 = s ; *s2 && *s2 != '/' ; s2--)
|
||||
for (s2 = s ; s2 > in && *s2 && *s2 != '/' ; s2--)
|
||||
;
|
||||
|
||||
if (in > s2)
|
||||
s2 = in;
|
||||
|
||||
if (s-s2 < 2)
|
||||
{
|
||||
if (s == s2)
|
||||
|
|
Loading…
Reference in a new issue