diff options
author | Jon TURNEY <jon.turney@dronecode.org.uk> | 2009-01-05 13:52:45 +0000 |
---|---|---|
committer | Jon TURNEY <jon.turney@dronecode.org.uk> | 2009-01-15 14:23:48 +0000 |
commit | c745db1674c3cb55249c9eb6e74939b74c42409c (patch) | |
tree | 2d34050d55a1d8af98ac34039cfe18c473538fab /glx | |
parent | e30032d0bbbf0bf71e1b53a4ac388f3bd6f68e53 (diff) |
GLX: Avoid a crash when we have an uninitialized GL context
If the GL dispatch table pointer points to glapi_noop_table,
(due to some kind of GL initialization failure), DoGetString(GL_VERSION)
(for example as invoked by glxinfo) will crash as it tries to
do atof() on the null pointer returned by the noop dispatch function
Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk>
Diffstat (limited to 'glx')
-rw-r--r-- | glx/single2.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/glx/single2.c b/glx/single2.c index 0ca808cc0..50a59ed71 100644 --- a/glx/single2.c +++ b/glx/single2.c @@ -335,6 +335,9 @@ int DoGetString(__GLXclientState *cl, GLbyte *pc, GLboolean need_swap) string = (const char *) CALL_GetString( GET_DISPATCH(), (name) ); client = cl->client; + if (string == NULL) + string = ""; + /* ** Restrict extensions to those that are supported by both the ** implementation and the connection. That is, return the |