[Mesa-dev] [PATCH] glx: Add assert after malloc before accessing memory in glx/clientattrib.c

Juha-Pekka Heikkila juhapekka.heikkila at gmail.com
Wed Nov 27 07:45:48 PST 2013


Signed-off-by: Juha-Pekka Heikkila <juhapekka.heikkila at gmail.com>
---
 src/glx/clientattrib.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/src/glx/clientattrib.c b/src/glx/clientattrib.c
index 1b306ea..6162b49 100644
--- a/src/glx/clientattrib.c
+++ b/src/glx/clientattrib.c
@@ -76,6 +76,9 @@ __indirect_glPushClientAttrib(GLuint mask)
    if (spp < &gc->attributes.stack[__GL_CLIENT_ATTRIB_STACK_DEPTH]) {
       if (!(sp = *spp)) {
          sp = malloc(sizeof(__GLXattribute));
+
+         assert(sp != NULL);
+
          *spp = sp;
       }
       sp->mask = mask;
-- 
1.8.1.2



More information about the mesa-dev mailing list