[Swan-dev] puzzled by TS code Coverity flagged

Andrew Cagney andrew.cagney at gmail.com
Thu Dec 22 01:10:50 EET 2022


On Wed, 21 Dec 2022 at 03:26, D. Hugh Redelmeier <hugh at mimosa.com> wrote:
>
> Coverity flags an uninitialized scalar value in ikev2_ts.c.
>
> The scalar in question is verify_rekey_child_request_ts()'s "best".
>
> Part of best seems to be initialized by calls to fit_tsp_to_end
> but only some paths through the function initialize.
>
> The bool result returned does not actually indicate whether initialization
> happened, but the caller seems to act as if it does.
>
> So: I think that Coverity is right: something is amiss.
>
> Since I havent taken the time to understand the code, I could be wrong.

Yea.  The code path doesn't care about best but it should probably
start out as zero.


More information about the Swan-dev mailing list