Don't modify a const input variable val; copy it to a scratch variable
authorTheodore Tso <tytso@mit.edu>
Mon, 18 Sep 1995 18:18:18 +0000 (18:18 +0000)
committerTheodore Tso <tytso@mit.edu>
Mon, 18 Sep 1995 18:18:18 +0000 (18:18 +0000)
and modify that.

git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@6811 dc483132-0cff-0310-8789-dd5450dbe970

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

index c1ffbd9c4c9bb6c5e6c657bcb63a0dc284c5481e..fad286a746b709b2b42a9ad968102d0d986c6399 100644 (file)
@@ -1,3 +1,9 @@
+Mon Sep 18 14:17:15 1995  Theodore Y. Ts'o  <tytso@dcl>
+
+       * asn1_encode.c (asn1_encode_generaltime): Don't modify a const
+               input variable val; copy it to a scratch variable and
+               modify that.
+
 Wed Sep 13 19:53:30 1995  Mark Eichin  <eichin@cygnus.com>
 
        * krb5_decode.c (clean_krb5_authenticator, clean_krb5_ticket,
index cbf290b861664cd8c4e11070469a2928f9c949a4..16c25ca24d51af5343d64b1ae9d75feba2b259df 100644 (file)
@@ -198,9 +198,10 @@ asn1_error_code asn1_encode_generaltime(buf, val, retlen)
   struct tm *gtime;
   char s[16];
   int length, sum=0;
+  time_t gmt_time;
 
-  val += EPOCH;
-  gtime = gmtime(&val);
+  gmt_time = val + EPOCH;
+  gtime = gmtime(&gmt_time);
 
   /* Time encoding: YYYYMMDDhhmmssZ */
   sprintf(s, "%04d%02d%02d%02d%02d%02dZ",