Re: crypto: api - Fix use-after-free and race in crypto_spawn_alg
From: Herbert Xu
Date: Wed Apr 15 2020 - 22:26:05 EST
On Wed, Apr 15, 2020 at 07:17:03PM -0700, Eric Biggers wrote:
>
> Wouldn't it be a bit simpler to set 'target = NULL', remove 'shoot',
> and use 'if (target)' instead of 'if (shoot)'?
Yes it is simpler but it's actually semantically different because
the compiler doesn't know that spawn->alg cannot be NULL in this
case.
Thanks,
--
Email: Herbert Xu <herbert@xxxxxxxxxxxxxxxxxxx>
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt