]> git.ipfire.org Git - thirdparty/krb5.git/commitdiff
Fix krb5int_open_plugin_dirs() error handling
authorMartin Kittel <martin.kittel@sap.com>
Wed, 15 Mar 2017 16:21:28 +0000 (17:21 +0100)
committerGreg Hudson <ghudson@mit.edu>
Wed, 29 Mar 2017 16:49:17 +0000 (12:49 -0400)
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

src/util/support/plugins.c

index b0bb2ada87558bd150694c5bdbbd56a5837020ee..47368be9d49be24250272b91147c64a343021949 100644 (file)
@@ -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);