Initialize return variable in decode_krb5_authdata()
git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@4327
dc483132-0cff-0310-8789-
dd5450dbe970
+Wed Sep 21 00:18:12 1994 Theodore Y. Ts'o (tytso@dcl)
+
+ * krb5_decode.c (decode_krb5_authdata): Initialize variable where
+ the authdata is returned to NULL first. (Caller shouldn't
+ have to do this.)
+
+ * asn1_decode.c (asn1_decode_generaltime): Plug memory leak caused
+ by not freeing temporary string.
+
Wed Aug 17 16:07:06 1994 Theodore Y. Ts'o (tytso at tsx-11)
* krb5_encode.c (encode_krb5_enc_kdc_rep_part): Older versions of
if(length != 15) return ASN1_BAD_LENGTH;
retval = asn1buf_remove_charstring(buf,15,&s);
/* Time encoding: YYYYMMDDhhmmssZ */
- if(s[14] != 'Z') return ASN1_BAD_FORMAT;
+ if(s[14] != 'Z') {
+ free(s);
+ return ASN1_BAD_FORMAT;
+ }
#define c2i(c) ((c)-'0')
ts.tm_year = 1000*c2i(s[0]) + 100*c2i(s[1]) + 10*c2i(s[2]) + c2i(s[3])
- 1900;
ts.tm_sec = 10*c2i(s[12]) + c2i(s[13]);
ts.tm_isdst = -1;
t = gmt_mktime(&ts);
+ free(s);
if(t == -1) return ASN1_BAD_TIMEFORMAT;
OLDDECLARG(krb5_authdata ***, rep)
{
setup_buf_only();
+ *rep = 0;
retval = asn1_decode_authorization_data(&buf,rep);
if(retval) return (krb5_error_code)retval;
cleanup();