diff --git a/nginx_module/src/timer.rs b/nginx_module/src/timer.rs index 423db39..caaa6c2 100644 --- a/nginx_module/src/timer.rs +++ b/nginx_module/src/timer.rs @@ -34,6 +34,10 @@ impl Drop for Timer { struct Data { handler: HandlerFn, interval_msec: usize, + // nginx debug logging reads ngx_event_ident(ev->data), i.e. + // ((ngx_connection_t *) data)->fd — 4 bytes at offset 24; keep the + // allocation large enough for that read to stay in bounds + _ident_pad: [u8; 32], } impl Timer { @@ -44,6 +48,7 @@ impl Timer { let data = Data { handler, interval_msec, + _ident_pad: [0; 32], }; event.data = Box::into_raw(Box::new(data)).cast(); event.log = unsafe { (*ngx_cycle).log };