mirror of
https://github.com/openssl/openssl.git
synced 2025-01-12 13:36:28 +08:00
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)
This commit is contained in:
parent
85155346b3
commit
f403feea11
@ -145,6 +145,7 @@ int ASYNC_WAIT_CTX_clear_fd(ASYNC_WAIT_CTX *ctx, const void *key)
|
||||
while (curr != NULL) {
|
||||
if (curr->del == 1) {
|
||||
/* This one has been marked deleted already so do nothing */
|
||||
prev = curr;
|
||||
curr = curr->next;
|
||||
continue;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user