freebsd-ports/games/openarena/files/patch-code_qcommon_common.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

16 lines
512 B
C

--- code/qcommon/common.c.orig 2011-12-24 12:29:32 UTC
+++ code/qcommon/common.c
@@ -2845,6 +2845,13 @@ void Com_WriteConfig_f( void ) {
Q_strncpyz( filename, Cmd_Argv(1), sizeof( filename ) );
COM_DefaultExtension( filename, sizeof( filename ), ".cfg" );
+
+ if (!COM_CompareExtension(filename, ".cfg"))
+ {
+ Com_Printf("Com_WriteConfig_f: Only the \".cfg\" extension is supported by this command!\n");
+ return;
+ }
+
Com_Printf( "Writing %s.\n", filename );
Com_WriteConfigToFile( filename );
}