From 7d1b5b4acbe71c32807f1fb0e6070269a5da97f7 Mon Sep 17 00:00:00 2001 From: Tim Angus Date: Wed, 19 Oct 2005 22:15:51 +0000 Subject: [PATCH] * Fix to buffer overrun in shader parser from misanthropia --- code/renderer/tr_shader.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/code/renderer/tr_shader.c b/code/renderer/tr_shader.c index f628b676..f896f31a 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