From 6727a36ad30525b71f3199bd3a1d2273fc2d6e52 Mon Sep 17 00:00:00 2001 From: Ken Raeburn Date: Thu, 7 Aug 2008 18:37:27 +0000 Subject: [PATCH] Don't use memcmp for comparing structures of values git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@20634 dc483132-0cff-0310-8789-dd5450dbe970 --- src/lib/krb5/ccache/cc_retr.c | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/src/lib/krb5/ccache/cc_retr.c b/src/lib/krb5/ccache/cc_retr.c index d6bdaca5b..1e25a048c 100644 --- a/src/lib/krb5/ccache/cc_retr.c +++ b/src/lib/krb5/ccache/cc_retr.c @@ -1,7 +1,7 @@ /* * lib/krb5/ccache/cc_retr.c * - * Copyright 1990,1991,1999,2007 by the Massachusetts Institute of Technology. + * Copyright 1990,1991,1999,2007,2008 by the Massachusetts Institute of Technology. * All Rights Reserved. * * Export of this software from the United States of America may @@ -33,7 +33,15 @@ #define set(bits) (whichfields & bits) #define flags_match(a,b) (((a) & (b)) == (a)) -#define times_match_exact(t1,t2) (memcmp((char *)(t1), (char *)(t2), sizeof(*(t1))) == 0) + +static int +times_match_exact(const krb5_ticket_times *t1, const krb5_ticket_times *t2) +{ + return (t1->authtime == t2->authtime && + t1->starttime == t2->starttime && + t1->endtime == t2->endtime && + t1->renew_till == t2->renew_till); +} static krb5_boolean times_match(const krb5_ticket_times *t1, const krb5_ticket_times *t2) -- 2.26.2