aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorthilo <thilo@edf5b092-35ff-0310-97b2-ce42778d08ea>2006-05-28 14:36:37 +0000
committerthilo <thilo@edf5b092-35ff-0310-97b2-ce42778d08ea>2006-05-28 14:36:37 +0000
commitd0abe049261a7a07e09e9d7e23a4dcd233813c2e (patch)
treea6fb7d73610df93037c0941ae0ef3d2761da530f
parent71e132351ea202b3edd7ad5df9a7a522861c1567 (diff)
downloadioquake3-aero-d0abe049261a7a07e09e9d7e23a4dcd233813c2e.tar.gz
ioquake3-aero-d0abe049261a7a07e09e9d7e23a4dcd233813c2e.zip
Prevent servers from making clients download files that are written to non-quake3 directories.
git-svn-id: svn://svn.icculus.org/quake3/trunk@790 edf5b092-35ff-0310-97b2-ce42778d08ea
-rw-r--r--code/client/cl_main.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/code/client/cl_main.c b/code/client/cl_main.c
index 9a1bcf6..da5d116 100644
--- a/code/client/cl_main.c
+++ b/code/client/cl_main.c
@@ -1443,6 +1443,13 @@ void CL_NextDownload(void) {
*s++ = 0;
else
s = localName + strlen(localName); // point at the nul byte
+
+ // Make sure the server cannot make us write to non-quake3 directories.
+ if(strstr(localName, "../"))
+ {
+ Com_Error(ERR_DROP, "CL_NextDownload: Invalid download name %s", localName);
+ return;
+ }
CL_BeginDownload( localName, remoteName );