On Mon, 2012-07-09 at 14:20 +0200, Sumit Bose wrote:
> On Tue, Jun 26, 2012 at 10:29:00AM +0200, Sumit Bose wrote:
> > Hi,
> > this patch fixes a small typo and silences a compiler warning. I think
> > it is right to use authdata instead of &authdata here, but I have to
> > admit that I cannot say why we have not seen any issues before.
> > bye,
> > Sumit
> I think I have an idea why both versions are working. I would expect
> that in the 'authdata' case gcc does not pass the krb5_authdata array
> by value but by reference. In the '&authdata' case gcc passes the
> pointer to the krb5_authdata array by value. As a result in both case
> the same address is on the stack and krb5_encode_authdata_container()
> can work as expected. I hope this makes sense.
Yes, by sheer luck authdata == &authdata when it is an array.
> Nevertheless I still think the 'authdata' version is the correct one.
Indeed it is.
Pushed to master
Simo Sorce * Red Hat, Inc * New York
Freeipa-devel mailing list