From 46da7790b2f327d49b20597c92a10de20a8efba3 Mon Sep 17 00:00:00 2001 From: Eric Anholt Date: Thu, 27 Mar 2014 17:32:16 -0700 Subject: [PATCH] test: Avoid segfaulting when nvidia driver does a dlopen(RTLD_DEFAULT) --- test/dlwrap.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/test/dlwrap.c b/test/dlwrap.c index 7b28c37..b104da4 100644 --- a/test/dlwrap.c +++ b/test/dlwrap.c @@ -79,6 +79,9 @@ find_wrapped_library(const char *filename) { unsigned i; + if (!filename) + return NULL; + for (i = 0; i < ARRAY_SIZE(wrapped_libs); i++) { if (strncmp(wrapped_libs[i].filename, filename, strlen(wrapped_libs[i].filename)) == 0) {