[Swan-dev] Coverity Scan thinks complete_v1_state_transition smells

D. Hugh Redelmeier hugh at mimosa.com
Sun Jun 10 21:41:20 UTC 2018


I don't really understand your answer (note: I'm not saying that you are 
wrong).

If you understand what's up, could you add a comment to make it 
understandable to other readers?

Testing is indispensible but it isn't sufficient.

| From: Andrew Cagney <andrew.cagney at gmail.com>

| Fortunately, it is IKEv1.  Move along, nothing to see.
| 
| --
| 
| While both complete_v[12]_state_transition() implementations stink.
| We don't need coverity to tell us that.  The good news is that we've
| managed to compensate by accumulating reasonable test coverage.
| 
| On 3 June 2018 at 20:34, D. Hugh Redelmeier <hugh at mimosa.com> wrote:
| > void complete_v1_state_transition(struct msg_digest **mdp, stf_status result)
| > {
| >         struct msg_digest *md = *mdp;
| >         passert(md != NULL);
| >
| >         ...
| >
| >         switch (result) {
| >         case STF_SUSPEND:
| >                 set_cur_state(md->st);  /* might have changed */
| >                 if (*mdp != NULL) {
| >
| > How could *mdp be NULL?
| >
| > (If I remember correctly, many years ago that could happen.  It was part
| > of the signal from the state transition function to
| > complete_v1_state_transition that md should not be freed.  But much
| > has changed since then.)
| >
| > Andrew: the closest fingerprints are yours.  Can you have a look?
| > _______________________________________________
| > Swan-dev mailing list
| > Swan-dev at lists.libreswan.org
| > https://lists.libreswan.org/mailman/listinfo/swan-dev
| 


More information about the Swan-dev mailing list