freebsd-ports/games/openarena/files/patch-code_client_cl__curl.c
Dominic Fandrey 75eb5eba72 games/openarena: Fix CVE-2017-6903
- Backport fix based on patchset for urbanterror [1]

[1] https://github.com/Barbatos/ioq3-for-UrbanTerror-4/pull/73

PR:		217911
Submitted by:	miwi
Approved by:	miwi (mentor)
MFH:		2017Q2
Security:	CVE-2017-6903
Security:	e48355d7-1548-11e7-8611-0090f5f2f347
Differential Revision:	https://reviews.freebsd.org/D10176
2017-05-18 20:58:59 +00:00

25 lines
763 B
C

--- code/client/cl_curl.c.orig 2011-12-24 12:29:31 UTC
+++ code/client/cl_curl.c
@@ -94,6 +94,13 @@ qboolean CL_cURL_Init()
Com_Printf("Loading \"%s\"...", cl_cURLLib->string);
+
+ if ( COM_CompareExtension( cl_cURLLib->string, ".pk3" ) )
+ {
+ Com_Printf( S_COLOR_RED "Rejecting cl_cURLLib named \"%s\"\n", cl_cURLLib->string );
+ return qfalse;
+ }
+
if( (cURLLib = Sys_LoadLibrary(cl_cURLLib->string)) == 0 )
{
#ifdef _WIN32
@@ -320,7 +327,7 @@ void CL_cURL_PerformDownload(void)
}
FS_FCloseFile(clc.download);
if(msg->msg == CURLMSG_DONE && msg->data.result == CURLE_OK) {
- FS_SV_Rename(clc.downloadTempName, clc.downloadName);
+ FS_SV_Rename(clc.downloadTempName, clc.downloadName, qfalse);
clc.downloadRestart = qtrue;
}
else {