From d397fd48d29f481d3b25d397d943fc1ea4bf7759 Mon Sep 17 00:00:00 2001 From: tma Date: Wed, 19 Oct 2005 22:15:51 +0000 Subject: * Fix to buffer overrun in shader parser from misanthropia git-svn-id: svn://svn.icculus.org/quake3/trunk@166 edf5b092-35ff-0310-97b2-ce42778d08ea --- code/renderer/tr_shader.c | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'code') 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 -- cgit v1.2.3