[nginx] Resolver: fixed possible use-after-free in worker on fast shutdown.

Ruslan Ermilov ru at nginx.com
Fri Dec 16 15:16:41 UTC 2016


details:   http://hg.nginx.org/nginx/rev/259e2a76e8fb
branches:  
changeset: 6844:259e2a76e8fb
user:      Ruslan Ermilov <ru at nginx.com>
date:      Fri Dec 16 14:53:28 2016 +0300
description:
Resolver: fixed possible use-after-free in worker on fast shutdown.

The fix in a3dc657f4e95 was incomplete.

diffstat:

 src/core/ngx_resolver.c |  4 ++++
 1 files changed, 4 insertions(+), 0 deletions(-)

diffs (14 lines):

diff -r a3dc657f4e95 -r 259e2a76e8fb src/core/ngx_resolver.c
--- a/src/core/ngx_resolver.c	Thu Dec 15 21:44:34 2016 +0300
+++ b/src/core/ngx_resolver.c	Fri Dec 16 14:53:28 2016 +0300
@@ -351,6 +351,10 @@ ngx_resolver_cleanup_tree(ngx_resolver_t
             next = ctx->next;
 
             if (ctx->event) {
+                if (ctx->event->timer_set) {
+                    ngx_del_timer(ctx->event);
+                }
+
                 ngx_resolver_free(r, ctx->event);
             }
 


More information about the nginx-devel mailing list