hw/xwin/glx: Fix glxLogExtensions to handle a null string without crashing

Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk>
Reviewed-by: Colin Harrison <colin.harrison@virgin.net>
This commit is contained in:
Jon TURNEY 2012-06-21 18:05:24 +01:00
parent c08c7c8f65
commit 8c24d20933

View File

@ -473,7 +473,7 @@ static void
glxLogExtensions(const char *prefix, const char *extensions)
{
int length = 0;
char *strl;
const char *strl;
char *str = strdup(extensions);
if (str == NULL) {
@ -482,6 +482,8 @@ glxLogExtensions(const char *prefix, const char *extensions)
}
strl = strtok(str, " ");
if (strl == NULL)
strl = "";
ErrorF("%s%s", prefix, strl);
length = strlen(prefix) + strlen(strl);