summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorJan Alexander Steffens (heftig) <jan.steffens@gmail.com>2018-03-08 22:30:41 +0100
committerAdam Jackson <ajax@redhat.com>2018-03-08 17:16:29 -0500
commit6c6fcd3b12ab44f97e57ba8a8c35447570f633f8 (patch)
tree0d05c7193482db0adb5655998f0075f7b685d886 /test
parentc28759fb3a53dc4628ea2e95f6d4bd2f6980b32d (diff)
downloadlibepoxy-6c6fcd3b12ab44f97e57ba8a8c35447570f633f8.tar.gz
test: Avoid egl_without_glx crash on NVIDIA
The NVIDIA driver calls dlopen with NULL as filename; strcmp is not NULL-safe.
Diffstat (limited to 'test')
-rw-r--r--test/egl_without_glx.c14
1 files changed, 8 insertions, 6 deletions
diff --git a/test/egl_without_glx.c b/test/egl_without_glx.c
index 9326b5a..195ef41 100644
--- a/test/egl_without_glx.c
+++ b/test/egl_without_glx.c
@@ -54,15 +54,17 @@ dlopen(const char *filename, int flag)
{
void * (*dlopen_unwrapped)(const char *filename, int flag);
- if (!strcmp(filename, "libGL.so.1"))
- return NULL;
+ if (filename) {
+ if (!strcmp(filename, "libGL.so.1"))
+ return NULL;
#if GLES_VERSION == 2
- if (!strcmp(filename, "libGLESv1_CM.so.1"))
- return NULL;
+ if (!strcmp(filename, "libGLESv1_CM.so.1"))
+ return NULL;
#else
- if (!strcmp(filename, "libGLESv2.so.2"))
- return NULL;
+ if (!strcmp(filename, "libGLESv2.so.2"))
+ return NULL;
#endif
+ }
dlopen_unwrapped = dlsym(RTLD_NEXT, "dlopen");
assert(dlopen_unwrapped);