[1184] in Kerberos_V5_Development

home help back first fref pref prev next nref lref last post

Re: key data version as array index

daemon@ATHENA.MIT.EDU (Marc Horowitz)
Wed May 15 17:24:22 1996

To: proven@cygnus.com
Cc: krbdev@MIT.EDU, "Barry Jaspan" <bjaspan@MIT.EDU>
Date: Wed, 15 May 1996 17:24:38 EDT
From: Marc Horowitz <marc@MIT.EDU>

>> > 
>> > I've seen code like this in a few places in libkdb:
>> > 
>> >     for (i = 0; i < key_data->key_data_ver; i++)
>> > 	if (key_data->key_data_contents[i])
>> > 	    krb5_xfree(key_data->key_data_contents[i]);
>> > 

I've seen this code, too.  I understood that its purpose was what
proven said, but something else bothers me.  IMHO, the code should
check the actual value of the key_data_ver, not use it as a loop
limit, since version 3 probably won't be just including another
type/length/contents tuple, and version 10 certainly won't include 10
of them.

		Marc


home help back first fref pref prev next nref lref last post