diff options
author | Ruslan Ermilov <ru@nginx.com> | 2016-12-03 10:01:39 +0300 |
---|---|---|
committer | Ruslan Ermilov <ru@nginx.com> | 2016-12-03 10:01:39 +0300 |
commit | cdd0cd6e2c8a8556477f7b22c32dd472af644d21 (patch) | |
tree | 1ec6a2780c9dffbee2dc745bdbca9d87573f99a2 /src/core/ngx_slab.c | |
parent | 34b41a70a606c254fdfc12a570c4514a24f06793 (diff) | |
download | nginx-cdd0cd6e2c8a8556477f7b22c32dd472af644d21.tar.gz nginx-cdd0cd6e2c8a8556477f7b22c32dd472af644d21.zip |
Slab: improved double free detection.
Previously, an attempt to double free the starting page of the
free range was not detected.
Diffstat (limited to 'src/core/ngx_slab.c')
-rw-r--r-- | src/core/ngx_slab.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/core/ngx_slab.c b/src/core/ngx_slab.c index b2adbf423..0fc63b5c4 100644 --- a/src/core/ngx_slab.c +++ b/src/core/ngx_slab.c @@ -597,7 +597,7 @@ ngx_slab_free_locked(ngx_slab_pool_t *pool, void *p) goto wrong_chunk; } - if (slab == NGX_SLAB_PAGE_FREE) { + if (!(slab & NGX_SLAB_PAGE_START)) { ngx_slab_error(pool, NGX_LOG_ALERT, "ngx_slab_free(): page is already free"); goto fail; |