Prevent NULL dereference in async clear-fd code
authorBenjamin Kaduk <bkaduk@akamai.com>
Fri, 27 Oct 2017 14:54:14 +0000 (09:54 -0500)
committerBen Kaduk <kaduk@mit.edu>
Mon, 30 Oct 2017 15:38:01 +0000 (10:38 -0500)
commitf403feea11d1ea26fd5b7d9732361cfc3f9f91a9
treed1529b103cd0fb5478e4a973b014f0c5c49ba3c4
parent85155346b3ca2dcdecf018dc8db9df94ceebeb0d
Prevent NULL dereference in async clear-fd code

If the list of fds contains only (one or more) entries marked
as deleted prior to the entry currently being deleted, and the
entry currently being deleted was only just added, the 'prev'
pointer would never be updated from its initial NULL value, and
we would dereference NULL while trying to remove the entry from
the linked list.

Reported by Coverity.

Reviewed-by: Kurt Roeckx <kurt@roeckx.be>
(Merged from https://github.com/openssl/openssl/pull/4602)
crypto/async/async_wait.c