Add string length checking to function COM_StripExtension. This fixes the R_RemapShader buffer overflow exploit that can be found here:
http://milw0rm.com/exploits/1750
This commit is contained in:
1 parent
2e368c02a6
commit
d21411452e
13 files changed
+22
-22
No files matched your search
@@ -58,10 +58,10 @@ char *COM_SkipPath (char *pathname)
|
||||
COM_StripExtension
|
||||
============
|
||||
*/
|
||||
void COM_StripExtension( const char *in, char *out ) {
|
||||
void COM_StripExtension( const char *in, char *out, int destsize ) {
|
||||
int length;
|
||||
|
||||
strcpy( out, in );
|
||||
Q_strncpyz(out, in, destsize);
|
||||
|
||||
length = strlen(out)-1;
|
||||
while (length > 0 && out[length] != '.')
|
||||
|
||||
Reference in new issue
Block a user