glx/tests: Fix off-by-one error in allocating extension string buffer
authorIan Romanick <ian.d.romanick@intel.com>
Mon, 4 Jun 2012 20:28:16 +0000 (13:28 -0700)
committerIan Romanick <ian.d.romanick@intel.com>
Tue, 3 Jul 2012 19:28:45 +0000 (12:28 -0700)
NOTE: This is a candidate for the 8.0 release branch.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=50621
Bugzilla: https://bugs.gentoo.org/show_bug.cgi?id=418161
Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Cc: Markus Oehme <oehme.markus@gmx.de>
src/glx/tests/fake_glx_screen.h

index 21515225971fc5dc8507570669a5a30eb35cd418..6aa6cb68fe94a950e27cb825067f9d21f307bf46 100644 (file)
@@ -40,7 +40,7 @@ public:
       this->display = glx_dpy;
       this->dpy = (glx_dpy != NULL) ? glx_dpy->dpy : NULL;
 
-      this->serverGLXexts = new char[strlen(ext)];
+      this->serverGLXexts = new char[strlen(ext) + 1];
       strcpy((char *) this->serverGLXexts, ext);
    }