r166 - trunk/code/renderer

DONOTREPLY at icculus.org DONOTREPLY at icculus.org
Wed Oct 19 18:15:51 EDT 2005


Author: tma
Date: 2005-10-19 18:15:51 -0400 (Wed, 19 Oct 2005)
New Revision: 166

Modified:
   trunk/code/renderer/tr_shader.c
Log:
* Fix to buffer overrun in shader parser from misanthropia


Modified: trunk/code/renderer/tr_shader.c
===================================================================
--- trunk/code/renderer/tr_shader.c	2005-10-19 01:51:19 UTC (rev 165)
+++ trunk/code/renderer/tr_shader.c	2005-10-19 22:15:51 UTC (rev 166)
@@ -1438,6 +1438,13 @@
 			}
 			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




More information about the quake3-commits mailing list