From: Martin Kittel Date: Wed, 15 Mar 2017 16:21:28 +0000 (+0100) Subject: Fix krb5int_open_plugin_dirs() error handling X-Git-Tag: krb5-1.16-beta1~119 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=ec56309e95e37cb3c91bad2a696b9bd094620876;p=thirdparty%2Fkrb5.git 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(). ticket: 8565 (new) target_version: 1.15-next target_version: 1.14-next tags: pullup --- diff --git a/src/util/support/plugins.c b/src/util/support/plugins.c index b0bb2ada87..47368be9d4 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);