summaryrefslogtreecommitdiffstats
path: root/src/util
diff options
context:
space:
mode:
authorKen Raeburn <raeburn@mit.edu>2006-03-13 21:56:26 +0000
committerKen Raeburn <raeburn@mit.edu>2006-03-13 21:56:26 +0000
commitc3f6e181e266f8469925930600bdaf3601eca321 (patch)
treec3125913849ef5170eefc908f3ae59a28910a270 /src/util
parent9ea5a3589deff92e64362ce0790f0a4869d19468 (diff)
downloadkrb5-c3f6e181e266f8469925930600bdaf3601eca321.tar.gz
krb5-c3f6e181e266f8469925930600bdaf3601eca321.tar.xz
krb5-c3f6e181e266f8469925930600bdaf3601eca321.zip
* plugins.c (krb5int_get_plugin_dir_data): If dirhandle is null or the
file pointer is null, return a one-element list containing just NULL. git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@17738 dc483132-0cff-0310-8789-dd5450dbe970
Diffstat (limited to 'src/util')
-rw-r--r--src/util/support/ChangeLog6
-rw-r--r--src/util/support/plugins.c8
2 files changed, 9 insertions, 5 deletions
diff --git a/src/util/support/ChangeLog b/src/util/support/ChangeLog
index eb112f60d..295f42f12 100644
--- a/src/util/support/ChangeLog
+++ b/src/util/support/ChangeLog
@@ -1,3 +1,9 @@
+2006-03-13 Ken Raeburn <raeburn@mit.edu>
+
+ * plugins.c (krb5int_get_plugin_dir_data): If dirhandle is null or
+ the file pointer is null, return a one-element list containing
+ just NULL.
+
2006-03-11 Ken Raeburn <raeburn@mit.edu>
* Makefile.in (autoconf.h): Note location change.
diff --git a/src/util/support/plugins.c b/src/util/support/plugins.c
index 8070db6a5..c245a70db 100644
--- a/src/util/support/plugins.c
+++ b/src/util/support/plugins.c
@@ -283,17 +283,14 @@ krb5int_get_plugin_dir_data (struct plugin_dir_handle *dirhandle,
void **p, **newp, *sym;
int count, i, err;
- if (dirhandle == NULL) {
- *ptrs = 0;
- return 0;
- }
-
/* XXX Do we need to add a leading "_" to the symbol name on any
modern platforms? */
Tprintf("get_plugin_data_sym(%s)\n", symname);
p = 0;
count = 0;
+ if (dirhandle == NULL || dirhandle->files == NULL)
+ goto skip_loop;
for (i = 0; !NULL_HANDLE (&dirhandle->files[i]); i++) {
int32_t kerr;
sym = NULL;
@@ -311,6 +308,7 @@ krb5int_get_plugin_dir_data (struct plugin_dir_handle *dirhandle,
p[count] = sym;
count++;
}
+skip_loop:
newp = realloc(p, (count+1) * sizeof(*p));
if (newp == NULL)
goto realloc_failure;