From: Vinson Lee Date: Sun, 28 Feb 2010 05:19:07 +0000 (-0800) Subject: glut: Add asserts to check for null pointer dereferences. X-Git-Tag: mesa-7.8~314 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=edd6c338cfa69b6bf9cac0922ebb9518fbca7eed;p=platform%2Fupstream%2Fmesa.git glut: Add asserts to check for null pointer dereferences. --- diff --git a/src/glut/glx/glut_event.c b/src/glut/glx/glut_event.c index d6d9638..4cdb814 100644 --- a/src/glut/glx/glut_event.c +++ b/src/glut/glx/glut_event.c @@ -664,6 +664,7 @@ processEventsAndTimeouts(void) case XK_KP_Delete: /* Introduced in X11R6. */ /* The Delete character is really an ASCII key. */ __glutSetWindow(window); + assert(keyboard); keyboard(127, /* ASCII Delete character. */ event.xkey.x, event.xkey.y); goto skip; @@ -1311,6 +1312,7 @@ processWindowWorkList(GLUTwindow * window) } /* Combine workMask with window->workMask to determine what finish and debug work there is. */ + assert(window); workMask |= window->workMask; if (workMask & GLUT_FINISH_WORK) {