summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorBrian Paul <brian.paul@tungstengraphics.com>2005-06-26 20:08:23 +0000
committerBrian Paul <brian.paul@tungstengraphics.com>2005-06-26 20:08:23 +0000
commit845f2a73506837e4ec4e0cf8bb99a2d63bdaf1b4 (patch)
tree4c22159c078ef6bb47623d6ee49dee76490f4493 /src
parentf8582b6c1f2403869d21bf57093f644284139802 (diff)
fix for-loop in _mesa_GetDouble to avoid out of bounds memory read
Diffstat (limited to 'src')
-rw-r--r--src/mesa/main/get.c2
-rw-r--r--src/mesa/main/get_gen.py2
2 files changed, 2 insertions, 2 deletions
diff --git a/src/mesa/main/get.c b/src/mesa/main/get.c
index b6f08efc34..fcc879576c 100644
--- a/src/mesa/main/get.c
+++ b/src/mesa/main/get.c
@@ -5627,7 +5627,7 @@ _mesa_GetDoublev( GLenum pname, GLdouble *params )
_mesa_GetFloatv(pname, values);
- for (i = 0; values[i] != magic && i < 16; i++)
+ for (i = 0; i < 16 && values[i] != magic; i++)
params[i] = (GLdouble) values[i];
}
diff --git a/src/mesa/main/get_gen.py b/src/mesa/main/get_gen.py
index 8259972daa..9f1be8b935 100644
--- a/src/mesa/main/get_gen.py
+++ b/src/mesa/main/get_gen.py
@@ -1178,7 +1178,7 @@ _mesa_GetDoublev( GLenum pname, GLdouble *params )
_mesa_GetFloatv(pname, values);
- for (i = 0; values[i] != magic && i < 16; i++)
+ for (i = 0; i < 16 && values[i] != magic; i++)
params[i] = (GLdouble) values[i];
}
"""