0
0
Fork 0
mirror of https://git.code.sf.net/p/quake/quakeforge synced 2025-03-22 18:31:27 +00:00

Fix a potential buffer underflow.

This commit is contained in:
Bill Currie 2011-09-09 17:30:07 +09:00
parent 8c67a872c6
commit 08fa6be9f4

View file

@ -651,7 +651,7 @@ qfs_expand_path (dstring_t *full_path, const char *base, const char *path,
if (*cpath == '/')
separator = "";
len = strlen (base);
if (base[len -1] == '/')
if (len && base[len - 1] == '/')
len--;
dsprintf (full_path, "%.*s%s%s", len, base, separator, cpath);
free (cpath);