[1187] in Kerberos_V5_Development
Re: key data version as array index
daemon@ATHENA.MIT.EDU (Christopher Provenzano)
Wed May 15 21:36:15 1996
Reply-To: proven@cygnus.com
To: "Barry Jaspan" <bjaspan@MIT.EDU>
Cc: marc@MIT.EDU, proven@cygnus.com, krbdev@MIT.EDU
In-Reply-To: Your message of "Wed, 15 May 1996 17:26:24 EDT."
<9605152126.AA29123@starkiller.MIT.EDU>
Date: Wed, 15 May 1996 21:33:45 -0400
From: Christopher Provenzano <proven@proven.org>
>
> >> >
> >> > 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...
>
> Well, right; that is the very issue that caused me to send the mail in
> the first place. I guess I didn't make the point clearly, though.
This is an effiecency hack. I don't need to lookup how many
type/length/content tuple array elements each of the different versions
have. Since we don't know what version 3 will contain (or even if
version 3 will ever exist) we don't know that it won't have 3 tuples.
So until version 3 comes out I don't see any reason to change it.
I definitely don't think adding an array count to the key_data structure
is necessary because it has very questionable future value.
CAP