summaryrefslogtreecommitdiffstats
path: root/src/glut/glx
diff options
context:
space:
mode:
authorBrian Paul <brian.paul@tungstengraphics.com>2006-05-10 19:21:16 +0000
committerBrian Paul <brian.paul@tungstengraphics.com>2006-05-10 19:21:16 +0000
commit700359ca5a9989e08739ff1a74e4806736bce99b (patch)
treec7e058b88cfe7f0fbbf365456b407468c3b3ee3b /src/glut/glx
parentadc0490420fa834197a37ffd1e64430333294d02 (diff)
check if button >= GLUT_MAX_MENUS in glutAttacheMenu()
Diffstat (limited to 'src/glut/glx')
-rw-r--r--src/glut/glx/glut_menu.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/glut/glx/glut_menu.c b/src/glut/glx/glut_menu.c
index 4e2cac27959..4c4a5ae7503 100644
--- a/src/glut/glx/glut_menu.c
+++ b/src/glut/glx/glut_menu.c
@@ -1000,6 +1000,10 @@ glutAddSubMenu(const char *label, int menu)
void GLUTAPIENTRY
glutAttachMenu(int button)
{
+ /* if button >= GLUT_MAX_MENUS, we'll go out of array bounds below */
+ if (button >= GLUT_MAX_MENUS) {
+ return;
+ }
if (__glutMappedMenu) {
__glutMenuModificationError();
}