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:
parent
c08c7c8f65
commit
8c24d20933
|
@ -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);
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user