+Thu May 29 19:39:08 1997 Theodore Y. Ts'o <tytso@mit.edu>
+
+ * kinit.c (main): Fix bug where kinit would core dump if given a
+ really long principal name.
+
Tue Feb 25 00:29:46 1997 Richard Basch <basch@lehman.com>
* kinit.c: Moved krb5_read_password back into the library (win32)
krb5_keytab keytab = NULL;
struct passwd *pw = 0;
int pwsize;
- char password[255], *client_name, prompt[255];
+ char password[255], *client_name, prompt[1024];
code = krb5_init_context(&kcontext);
if (code) {
exit(1);
}
} else {
- if (code = krb5_parse_name(kcontext, service_name, &server)) {
+ if ((code = krb5_parse_name(kcontext, service_name, &server))) {
com_err(argv[0], code, "while parsing service name %s",
service_name);
exit(1);
if (!use_keytab)
#endif
{
- (void) sprintf(prompt,"Password for %s: ", (char *) client_name);
+ (void) sprintf(prompt, "Password for %.*s: ",
+ sizeof(prompt)-32, (char *) client_name);
pwsize = sizeof(password);