Skip to content

Commit

Permalink
Fix potential buffer overflow caused by long tcMod args
Browse files Browse the repository at this point in the history
Found by Coverity.
  • Loading branch information
zturtleman committed May 25, 2014
1 parent 9c99cf2 commit eeeaf3f
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions code/renderergl1/tr_shader.c
Expand Up @@ -1010,8 +1010,8 @@ static qboolean ParseStage( shaderStage_t *stage, char **text )
token = COM_ParseExt( text, qfalse );
if ( token[0] == 0 )
break;
strcat( buffer, token );
strcat( buffer, " " );
Q_strcat( buffer, sizeof (buffer), token );
Q_strcat( buffer, sizeof (buffer), " " );
}

ParseTexMod( buffer, stage );
Expand Down
4 changes: 2 additions & 2 deletions code/renderergl2/tr_shader.c
Expand Up @@ -1265,8 +1265,8 @@ static qboolean ParseStage( shaderStage_t *stage, char **text )
token = COM_ParseExt( text, qfalse );
if ( token[0] == 0 )
break;
strcat( buffer, token );
strcat( buffer, " " );
Q_strcat( buffer, sizeof (buffer), token );
Q_strcat( buffer, sizeof (buffer), " " );
}

ParseTexMod( buffer, stage );
Expand Down

0 comments on commit eeeaf3f

Please sign in to comment.