]> git.kaiwu.me - nginx.git/commit
Resolver: fixed crashes in timeout handler.
authorRuslan Ermilov <ru@nginx.com>
Tue, 26 Jan 2016 13:46:31 +0000 (16:46 +0300)
committerRuslan Ermilov <ru@nginx.com>
Tue, 26 Jan 2016 13:46:31 +0000 (16:46 +0300)
commit4b581a7c21e4328d059bf400a059c0458fc9f806
tree35df965733bf5eacb649569b856efd4572ff6a57
parentc44fd4e837f979912749a5a19490ccb9b46398d3
Resolver: fixed crashes in timeout handler.

If one or more requests were waiting for a response, then after
getting a CNAME response, the timeout event on the first request
remained active, pointing to the wrong node with an empty
rn->waiting list, and that could cause either null pointer
dereference or use-after-free memory access if this timeout
expired.

If several requests were waiting for a response, and the first
request terminated (e.g., due to client closing a connection),
other requests were left without a timeout and could potentially
wait indefinitely.

This is fixed by introducing per-request independent timeouts.
This change also reverts 954867a2f0a6 and 5004210e8c78.
src/core/ngx_resolver.c
src/core/ngx_resolver.h