+Mon Oct 23 17:08:59 1995 Theodore Y. Ts'o <tytso@dcl>
+
+ * in_tkt_pwd.c (krb5_get_in_tkt_with_password): Fix to properly
+ malloc password buffer.
+
Mon Oct 23 11:09:56 1995 Ezra Peisach <epeisach@kangaroo.mit.edu>
* rd_req_dec.c (krb5_rd_req_decoded): For heirarchal cross-realm,
and then there is an error, make sure return pointer is not
looking at freed memory.
-
Fri Oct 6 22:04:42 1995 Theodore Y. Ts'o <tytso@dcl>
* Makefile.in: Remove ##DOS!include of config/windows.in.
{
krb5_error_code retval;
krb5_encrypt_block eblock;
- char pwdbuf[BUFSIZ];
krb5_data * password;
- int pwsize = sizeof(pwdbuf);
+ int pwsize;
if (!valid_enctype(type))
return KRB5_PROG_ETYPE_NOSUPP;
password = (krb5_data *)keyseed;
if (!password->length) {
+ pwsize = BUFSIZ;
+ if ((password->data = malloc(password->length)) == NULL)
+ return ENOMEM;
+
if ((retval = krb5_read_password(context, krb5_default_pwd_prompt1, 0,
- pwdbuf, &pwsize))) {
+ password->data, &pwsize))) {
return retval;
}
- password->length = pwsize;
- password->data = pwdbuf;
+ password->length = pwsize;
}
if (!(*key = (krb5_keyblock *)malloc(sizeof(**key))))
pwd_keyproc, (krb5_pointer) &data,
krb5_kdc_rep_decrypt_proc, 0,
creds, ccache, ret_as_reply);
+
+ if ((password == NULL) && (data.data)) {
+ memset(data.data, 0, strlen(data.data));
+ free(data.data);
+ }
+
return retval;
}