Skip to content
Snippets Groups Projects
Commit af597e28 authored by Moe Jette's avatar Moe Jette
Browse files

Avoid infinite loop if invalid plugin path specified, parsing error

parent 6e7dac68
No related branches found
No related tags found
No related merge requests found
/*****************************************************************************\
* plugin.h - plugin architecture implementation.
*****************************************************************************
* Copyright (C) 2002 The Regents of the University of California.
* Copyright (C) 2002-2007 The Regents of the University of California.
* Copyright (C) 2008 Lawrence Livermore National Security.
* Produced at Lawrence Livermore National Laboratory (cf, DISCLAIMER).
* Written by Jay Windley <jwindley@lnxi.com>.
* LLNL-CODE-402394.
......@@ -195,7 +196,6 @@ plugin_load_and_link(const char *type_name, int n_syms,
}
head = dir_array;
i=0;
for (i=0; ; i++) {
bool got_colon = 0;
if (dir_array[i] == ':') {
......@@ -208,17 +208,17 @@ plugin_load_and_link(const char *type_name, int n_syms,
debug3("Trying to load plugin %s", file_name);
if ((stat(file_name, &st) < 0) || (!S_ISREG(st.st_mode))) {
xfree(file_name);
continue;
} else {
plug = plugin_load_from_file(file_name);
xfree(file_name);
if (plugin_get_syms(plug, n_syms, names, ptrs) >=
n_syms) {
debug3("Success.");
break;
} else
plug = PLUGIN_INVALID_HANDLE;
}
plug = plugin_load_from_file(file_name);
xfree(file_name);
if (plugin_get_syms(plug, n_syms, names, ptrs) >= n_syms) {
debug3("Success.");
break;
} else
plug = PLUGIN_INVALID_HANDLE;
if (got_colon) {
head = dir_array + i + 1;
} else
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment