From f452cb9821e2ee9034fc83b5ec98347fab647488 Mon Sep 17 00:00:00 2001 From: Tom Yu Date: Wed, 16 Jul 2008 23:01:54 +0000 Subject: Apply patch from Mark Phalan to initialize progname before use ticket: 6028 target_version: 1.6.4 tags: pullup git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@20531 dc483132-0cff-0310-8789-dd5450dbe970 --- src/plugins/kdb/ldap/ldap_util/kdb5_ldap_util.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'src/plugins') diff --git a/src/plugins/kdb/ldap/ldap_util/kdb5_ldap_util.c b/src/plugins/kdb/ldap/ldap_util/kdb5_ldap_util.c index 34a2fc808..e2776b985 100644 --- a/src/plugins/kdb/ldap/ldap_util/kdb5_ldap_util.c +++ b/src/plugins/kdb/ldap/ldap_util/kdb5_ldap_util.c @@ -303,6 +303,11 @@ int main(argc, argv) krb5_boolean realm_name_required = TRUE; krb5_boolean print_help_message = FALSE; + /* + * Ensure that "progname" is set before calling com_err. + */ + progname = (strrchr(argv[0], '/') ? strrchr(argv[0], '/')+1 : argv[0]); + retval = krb5_init_context(&util_context); set_com_err_hook(extended_com_err_fn); if (retval) { @@ -311,8 +316,6 @@ int main(argc, argv) goto cleanup; } - progname = (strrchr(argv[0], '/') ? strrchr(argv[0], '/')+1 : argv[0]); - cmd_argv = (char **) malloc(sizeof(char *)*argc); if (cmd_argv == NULL) { com_err(progname, ENOMEM, "while creating sub-command arguments"); -- cgit