summaryrefslogtreecommitdiff
path: root/hw
diff options
context:
space:
mode:
authorJon TURNEY <jon.turney@dronecode.org.uk>2012-06-21 18:05:24 +0100
committerJon TURNEY <jon.turney@dronecode.org.uk>2012-06-21 18:36:40 +0100
commit8c24d20933ba9c2ef0e9a81815c3be23fa896aea (patch)
treee8b15c028204e020ed531a93b7c52cc4d170f53b /hw
parentc08c7c8f655d7721c1e02bfeeb965b6379f72553 (diff)
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>
Diffstat (limited to 'hw')
-rw-r--r--hw/xwin/glx/indirect.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/hw/xwin/glx/indirect.c b/hw/xwin/glx/indirect.c
index 56f677a8f..41b4cd8b3 100644
--- a/hw/xwin/glx/indirect.c
+++ b/hw/xwin/glx/indirect.c
@@ -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);