From 42b49307b96a01c70ee4fde387f79c6f1fcf2595 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Stefan=20B=C3=BChler?= Date: Tue, 28 May 2013 10:03:34 +0200 Subject: [PATCH] [mod_fastcgi] next try to fix use after free --- src/modules/fastcgi_stream.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/modules/fastcgi_stream.c b/src/modules/fastcgi_stream.c index 5770f1d..c74fd46 100644 --- a/src/modules/fastcgi_stream.c +++ b/src/modules/fastcgi_stream.c @@ -660,7 +660,6 @@ static void fastcgi_decode(liFastCGIBackendContext *ctx) { fcgi_debug("fastcgi end request: %i\n", appStatus); callbacks->end_request_cb(ctx->currentcon->vr, &ctx->pool->public, &ctx->currentcon->public, appStatus); - if (NULL == ctx->iostream->stream_in.out) return; } } break; @@ -722,7 +721,7 @@ static void fastcgi_decode(liFastCGIBackendContext *ctx) { } } - if (0 == in->length || ctx->remainingContent > 0) return; + if (NULL == ctx->iostream || 0 == in->length || ctx->remainingContent > 0) break; if (ctx->remainingPadding > 0) { int len = li_chunkqueue_skip(in, ctx->remainingPadding); @@ -730,7 +729,7 @@ static void fastcgi_decode(liFastCGIBackendContext *ctx) { } } - if (in->is_closed && !ctx->request_done) { + if (NULL != ctx->iostream && (in->is_closed && !ctx->request_done)) { if (0 != in->length || !ctx->stdout_closed) { fastcgi_reset(ctx); } else {