diff options
author | Martin Kittel <martin.kittel@sap.com> | 2017-03-15 17:21:28 +0100 |
---|---|---|
committer | Greg Hudson <ghudson@mit.edu> | 2017-07-17 17:15:01 -0400 |
commit | ae9e99e9a3d41442128bdcb3b86fb3677db7c2d1 (patch) | |
tree | bc358a9072824c605151c71a377add36d510790a | |
parent | 06ad6810d86641489e2c05be0a74aeef36811be9 (diff) | |
download | krb5-ae9e99e9a3d41442128bdcb3b86fb3677db7c2d1.zip krb5-ae9e99e9a3d41442128bdcb3b86fb3677db7c2d1.tar.gz krb5-ae9e99e9a3d41442128bdcb3b86fb3677db7c2d1.tar.bz2 |
Fix krb5int_open_plugin_dirs() error handling
In krb5int_open_plugin_dirs(), if constructing filepath fails,
filepath is set to null but accessed a few lines later. Add an error
check before calling krb5int_open_plugin().
(cherry picked from commit ec56309e95e37cb3c91bad2a696b9bd094620876)
ticket: 8565
version_fixed: 1.15.2
-rw-r--r-- | src/util/support/plugins.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/src/util/support/plugins.c b/src/util/support/plugins.c index b0bb2ad..47368be 100644 --- a/src/util/support/plugins.c +++ b/src/util/support/plugins.c @@ -592,9 +592,10 @@ krb5int_open_plugin_dirs (const char * const *dirnames, } } - if (krb5int_open_plugin (filepath, &handle, ep) == 0) { + if (!err && krb5int_open_plugin(filepath, &handle, ep) == 0) { err = krb5int_plugin_file_handle_array_add (&h, &count, handle); - if (!err) { handle = NULL; } /* h takes ownership */ + if (!err) + handle = NULL; /* h takes ownership */ } free(filepath); |