From d3941b54d7247831c765e75e5f5c04c66d061f78 Mon Sep 17 00:00:00 2001 From: Jon Ashburn Date: Fri, 16 Jan 2015 08:46:38 -0700 Subject: loader: Fix infinite loop on layer library scan if dlopen fails --- loader/loader.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/loader/loader.c b/loader/loader.c index 8a0b3eb9..548a9aa3 100644 --- a/loader/loader.c +++ b/loader/loader.c @@ -435,8 +435,10 @@ static void layer_lib_scan(const char * libInPaths) if (!strncmp(dent->d_name, "libXGLLayer", strlen("libXGLLayer"))) { void * handle; snprintf(temp_str, sizeof(temp_str), "%s/%s",p,dent->d_name); - if ((handle = dlopen(temp_str, RTLD_LAZY)) == NULL) + if ((handle = dlopen(temp_str, RTLD_LAZY)) == NULL) { + dent = readdir(curdir); continue; + } if (loader.scanned_layer_count == MAX_LAYER_LIBRARIES) { loader_log(XGL_DBG_MSG_ERROR, 0, "%s ignored: max layer libraries exceed", temp_str); break; -- cgit v1.2.3