From a11fa76d13a0b4ad4575774e1fd68bde1f4097cb Mon Sep 17 00:00:00 2001
From: /dev/humancontroller <devhc@example.com>
Date: Mon, 16 Feb 2015 22:58:33 +0100
Subject: add range checks for uiInfo.resolutions

---
 src/ui/ui_main.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

(limited to 'src/ui')

diff --git a/src/ui/ui_main.c b/src/ui/ui_main.c
index 9f7aacc7..8b516f05 100644
--- a/src/ui/ui_main.c
+++ b/src/ui/ui_main.c
@@ -3982,7 +3982,7 @@ void UI_ParseResolutions( void )
   p = buf;
   uiInfo.numResolutions = 0;
 
-  while( String_Parse( &p, &out ) )
+  while( uiInfo.numResolutions < MAX_RESOLUTIONS && String_Parse( &p, &out ) )
   {
     Q_strncpyz( w, out, sizeof( w ) );
     s = strchr( w, 'x' );
-- 
cgit