diff options
author | Roel Kluin <roel.kluin@gmail.com> | 2010-01-06 08:27:42 -0800 |
---|---|---|
committer | Brian Paul <brianp@vmware.com> | 2010-01-06 09:47:37 -0700 |
commit | 324568f79d6e014900c981bd9a0e1dffedc326c8 (patch) | |
tree | 04c0dc711d64d575fb9adc02107803bec5c2257f /src/mesa/drivers/dri/tdfx | |
parent | 5db710a8231fe50d2faad8e9adb2a07616cc6130 (diff) |
mesa: test index bounds before array element
Check whether the index is within bounds before accessing the array.
Signed-off-by: Roel Kluin <roel.kluin@gmail.com>
Signed-off-by: Brian Paul <brianp@vmware.com>
Diffstat (limited to 'src/mesa/drivers/dri/tdfx')
-rw-r--r-- | src/mesa/drivers/dri/tdfx/tdfx_dd.c | 2 |
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 8472df607a..ed8a331549 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] = '-'; } |