From: Ezra Peisach Date: Tue, 28 Dec 2004 13:27:30 +0000 (+0000) Subject: Memory leak in asn1_decode_generaltime X-Git-Tag: ms-bug-test-20060525~414 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=91c8943dba9cd0b123808ccfcb6b4e9ea9cb51bd;p=krb5.git Memory leak in asn1_decode_generaltime When decoding a kerberos time, if the asn1 time is 19700101000000Z (i.e. time_t of 0) - 15 bytes of memory are lost. * asn1_decode.c (asn1_decode_generaltime): Fix memory leak when time sent is "19700101000000Z". ticket: new tags: pullup git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@16983 dc483132-0cff-0310-8789-dd5450dbe970 --- diff --git a/src/lib/krb5/asn.1/ChangeLog b/src/lib/krb5/asn.1/ChangeLog index e7ea80367..4baf064f2 100644 --- a/src/lib/krb5/asn.1/ChangeLog +++ b/src/lib/krb5/asn.1/ChangeLog @@ -1,3 +1,8 @@ +2004-12-28 Ezra Peisach + + * asn1_decode.c (asn1_decode_generaltime): Fix memory leak when + time sent is "19700101000000Z". + 2004-08-31 Tom Yu * asn1buf.c: Fix denial-of-service bug. diff --git a/src/lib/krb5/asn.1/asn1_decode.c b/src/lib/krb5/asn.1/asn1_decode.c index 60ae08802..d31ce3e3b 100644 --- a/src/lib/krb5/asn.1/asn1_decode.c +++ b/src/lib/krb5/asn.1/asn1_decode.c @@ -238,6 +238,7 @@ asn1_error_code asn1_decode_generaltime(asn1buf *buf, time_t *val) } if(s[0] == '1' && !memcmp("19700101000000Z", s, 15)) { t = 0; + free(s); goto done; } #define c2i(c) ((c)-'0')