Skip to content

Commit 93e0804

Browse files
committed
fix(nginx): safe guard against null last chain
1 parent 0d60a48 commit 93e0804

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/ngx_http_redirectionio_module_filter.c

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -262,7 +262,10 @@ ngx_int_t ngx_http_redirectionio_body_filter(ngx_http_request_t *r, ngx_chain_t
262262
if (tmp_chain == NULL) {
263263
if (ctx->body_filter == NULL) {
264264
// Case where the body filter has been closed and we receive NULL, which means we have to send the last buffer as last
265-
last_chain->buf->last_buf = 1;
265+
if (last_chain != NULL) {
266+
last_chain->buf->last_buf = 1;
267+
}
268+
266269
break;
267270
}
268271

0 commit comments

Comments
 (0)