summaryrefslogtreecommitdiffhomepage
path: root/src/nxt_unit.c
diff options
context:
space:
mode:
authorMax Romanov <max.romanov@nginx.com>2020-02-03 11:21:21 +0300
committerMax Romanov <max.romanov@nginx.com>2020-02-03 11:21:21 +0300
commit8eba2e5c3d8537521d3e010025e6078bc1fd28d6 (patch)
treea3196192c526c73d7094e2dc1ba5601a362cf7c0 /src/nxt_unit.c
parent7ea9ebc55a22fec53bb095975e639d4fbfebb575 (diff)
downloadunit-8eba2e5c3d8537521d3e010025e6078bc1fd28d6.tar.gz
unit-8eba2e5c3d8537521d3e010025e6078bc1fd28d6.tar.bz2
Initializing local buffer ctx_impl field for correct release.
Uninitialized ctx_impl field may cause crash in application process. To reproduce the issue, need to trigger shared memory buffer send error on application side. In our case, send error caused by router process crash. This issue was introduced in 2c7f79bf0a1f.
Diffstat (limited to '')
-rw-r--r--src/nxt_unit.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/src/nxt_unit.c b/src/nxt_unit.c
index 27dc4751..ab622e56 100644
--- a/src/nxt_unit.c
+++ b/src/nxt_unit.c
@@ -3207,6 +3207,7 @@ nxt_unit_get_outgoing_buf(nxt_unit_ctx_t *ctx, nxt_unit_process_t *process,
mmap_buf->port_id = *port_id;
mmap_buf->process = process;
mmap_buf->free_ptr = NULL;
+ mmap_buf->ctx_impl = nxt_container_of(ctx, nxt_unit_ctx_impl_t, ctx);
nxt_unit_debug(ctx, "outgoing mmap allocation: (%d,%d,%d)",
(int) hdr->id, (int) c,