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>
This commit is contained in:
Jon TURNEY 2009-01-05 13:52:45 +00:00
parent e30032d0bb
commit c745db1674

View File

@ -335,6 +335,9 @@ int DoGetString(__GLXclientState *cl, GLbyte *pc, GLboolean need_swap)
string = (const char *) CALL_GetString( GET_DISPATCH(), (name) ); string = (const char *) CALL_GetString( GET_DISPATCH(), (name) );
client = cl->client; client = cl->client;
if (string == NULL)
string = "";
/* /*
** Restrict extensions to those that are supported by both the ** Restrict extensions to those that are supported by both the
** implementation and the connection. That is, return the ** implementation and the connection. That is, return the