diff options
author | tma <tma@edf5b092-35ff-0310-97b2-ce42778d08ea> | 2005-10-19 22:15:51 +0000 |
---|---|---|
committer | tma <tma@edf5b092-35ff-0310-97b2-ce42778d08ea> | 2005-10-19 22:15:51 +0000 |
commit | d397fd48d29f481d3b25d397d943fc1ea4bf7759 (patch) | |
tree | 2e1565bf5f127756ebd264bc3b3080f4350ef59f /code/renderer | |
parent | d1b40116d4c2cfb5c3e01c55449e9c953f425a39 (diff) | |
download | ioquake3-aero-d397fd48d29f481d3b25d397d943fc1ea4bf7759.tar.gz ioquake3-aero-d397fd48d29f481d3b25d397d943fc1ea4bf7759.zip |
* Fix to buffer overrun in shader parser from misanthropia
git-svn-id: svn://svn.icculus.org/quake3/trunk@166 edf5b092-35ff-0310-97b2-ce42778d08ea
Diffstat (limited to 'code/renderer')
-rw-r--r-- | code/renderer/tr_shader.c | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/code/renderer/tr_shader.c b/code/renderer/tr_shader.c index f628b67..f896f31 100644 --- a/code/renderer/tr_shader.c +++ b/code/renderer/tr_shader.c @@ -1438,6 +1438,13 @@ static qboolean ParseShader( char **text ) } stages[s].active = qtrue; s++; + + // 20051019 misantropia -- fix buffer overrun. + if ( s >= MAX_SHADER_STAGES ) { + ri.Printf( PRINT_WARNING, "WARNING: too many stages in shader %s\n", shader.name ); + return qfalse; + } + continue; } // skip stuff that only the QuakeEdRadient needs |