(racoon 735) Re: racoon + Cisco VPN Client

VANHULLEBUS Yvan <[email protected]> Tue, 14 Sep 2004 17:11:02 +0200
Newsgroups gmane.network.ipv6.kame.racoon
Message-ID <[email protected]>
On Tue, Sep 14, 2004 at 10:31:06AM -0400, Richard Whalen wrote:
> I have been working on merging these changes with changes to allow Racoon to
> be used with MultiNet on VMS, and came across the following in isakmp.c that
> is questionable:

int func(){
    int res;

    res=1;

    return res;
}

This function is good, do you agree ?

That's exactly the same with set_isakmp_header !


> Notice that res is declared as a (stack) local variable, and is returned as
> the value of the function.  This will lead to corruption.

No, the function does not returns "res", but a copy of res value,
chich will be stored in the lvalue in the calling code !

If the function returned &res, yes, this would lead to illegal stack
access, but that's not the case !


Yvan.