summaryrefslogtreecommitdiffstats
path: root/src/mesa/drivers/dri/tdfx
diff options
context:
space:
mode:
authorRoel Kluin <[email protected]>2010-01-06 08:27:42 -0800
committerBrian Paul <[email protected]>2010-01-06 09:47:37 -0700
commit324568f79d6e014900c981bd9a0e1dffedc326c8 (patch)
tree04c0dc711d64d575fb9adc02107803bec5c2257f /src/mesa/drivers/dri/tdfx
parent5db710a8231fe50d2faad8e9adb2a07616cc6130 (diff)
mesa: test index bounds before array element
Check whether the index is within bounds before accessing the array. Signed-off-by: Roel Kluin <[email protected]> Signed-off-by: Brian Paul <[email protected]>
Diffstat (limited to 'src/mesa/drivers/dri/tdfx')
-rw-r--r--src/mesa/drivers/dri/tdfx/tdfx_dd.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/mesa/drivers/dri/tdfx/tdfx_dd.c b/src/mesa/drivers/dri/tdfx/tdfx_dd.c
index 8472df607ae..ed8a3315492 100644
--- a/src/mesa/drivers/dri/tdfx/tdfx_dd.c
+++ b/src/mesa/drivers/dri/tdfx/tdfx_dd.c
@@ -91,7 +91,7 @@ static const GLubyte *tdfxDDGetString( GLcontext *ctx, GLenum name )
else {
/* unexpected result: replace spaces with hyphens */
int i;
- for (i = 0; hardware[i] && (i < sizeof(hardware)); i++) {
+ for (i = 0; i < sizeof(hardware) && hardware[i]; i++) {
if (hardware[i] == ' ' || hardware[i] == '\t') {
hardware[i] = '-';
}