Memory leak in asn1_decode_generaltime
authorEzra Peisach <epeisach@mit.edu>
Tue, 28 Dec 2004 13:27:30 +0000 (13:27 +0000)
committerEzra Peisach <epeisach@mit.edu>
Tue, 28 Dec 2004 13:27:30 +0000 (13:27 +0000)
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

src/lib/krb5/asn.1/ChangeLog
src/lib/krb5/asn.1/asn1_decode.c

index e7ea803677b0765c974e766c8fa1aa10c057c5e1..4baf064f23225164e6b75a0aa09581f9001914c5 100644 (file)
@@ -1,3 +1,8 @@
+2004-12-28  Ezra Peisach  <epeisach@mit.edu>
+
+       * asn1_decode.c (asn1_decode_generaltime): Fix memory leak when
+       time sent is "19700101000000Z".
+
 2004-08-31  Tom Yu  <tlyu@mit.edu>
 
        * asn1buf.c: Fix denial-of-service bug.
index 60ae08802d2d4869f06c49ffb4eba5678886d97e..d31ce3e3b160c7e914f4be603a7a05590fdc612d 100644 (file)
@@ -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')