+Thu Aug 7 15:53:13 1997 Tom Yu <tlyu@mit.edu>
+
+ * g_cnffile.c: Check to see if context is NULL prior to calling
+ profile_get_values. Fixes krb5-libs/317.
+
Wed Apr 9 23:15:39 1997 Tom Yu <tlyu@mit.edu>
* realmofhost.c (krb_realmofhost): Add bounds checking to various
names[0] = "libdefaults";
names[1] = s;
names[2] = 0;
- retval = profile_get_values(context->profile, names, &full_name);
- if (retval == 0 && full_name && full_name[0]) {
+ if (context) {
+ retval = profile_get_values(context->profile, names, &full_name);
+ if (retval == 0 && full_name && full_name[0]) {
cnffile = fopen(full_name[0],"r");
for (cpp = full_name; *cpp; cpp++)
- krb5_xfree(*cpp);
+ krb5_xfree(*cpp);
krb5_xfree(full_name);
+ }
+ krb5_free_context(context);
}
- krb5_free_context(context);
return cnffile;
}
names[0] = "libdefaults";
names[1] = "krb4_srvtab";
names[2] = 0;
- retval = profile_get_values(context->profile, names, &full_name);
- if (retval == 0 && full_name && full_name[0]) {
- retname = strdup(full_name[0]);
- for (cpp = full_name; *cpp; cpp++)
- krb5_xfree(*cpp);
- krb5_xfree(full_name);
- } else {
- retname = strdup(default_srvtabname);
+ if (context &&
+ (retval = profile_get_values(context->profile, names, &full_name))
+ && retval == 0 && full_name && full_name[0]) {
+ retname = strdup(full_name[0]);
+ for (cpp = full_name; *cpp; cpp++)
+ krb5_xfree(*cpp);
+ krb5_xfree(full_name);
+ }else {
+ retname = strdup(default_srvtabname);
}
krb5_free_context(context);
return retname;