From deccbecd88ad91c6d99c8e01003d153428afa97a Mon Sep 17 00:00:00 2001 From: Theodore Tso Date: Mon, 18 Sep 1995 18:18:18 +0000 Subject: [PATCH] Don't modify a const input variable val; copy it to a scratch variable and modify that. git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@6811 dc483132-0cff-0310-8789-dd5450dbe970 --- src/lib/krb5/asn.1/ChangeLog | 6 ++++++ src/lib/krb5/asn.1/asn1_encode.c | 5 +++-- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/src/lib/krb5/asn.1/ChangeLog b/src/lib/krb5/asn.1/ChangeLog index c1ffbd9c4..fad286a74 100644 --- a/src/lib/krb5/asn.1/ChangeLog +++ b/src/lib/krb5/asn.1/ChangeLog @@ -1,3 +1,9 @@ +Mon Sep 18 14:17:15 1995 Theodore Y. Ts'o + + * 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 * krb5_decode.c (clean_krb5_authenticator, clean_krb5_ticket, diff --git a/src/lib/krb5/asn.1/asn1_encode.c b/src/lib/krb5/asn.1/asn1_encode.c index cbf290b86..16c25ca24 100644 --- a/src/lib/krb5/asn.1/asn1_encode.c +++ b/src/lib/krb5/asn.1/asn1_encode.c @@ -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", -- 2.26.2