Nginx-ru mailing list archive (nginx-ru@sysoev.ru)
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
patch for mod-ctpp2 r15 (error fixed)
- To: i@xxxxxxxx
- Subject: patch for mod-ctpp2 r15 (error fixed)
- From: "Igor A. Valcov" <viaprog@xxxxxxxxx>
- Date: Thu, 18 Nov 2010 11:58:41 +0300
- Cc: nginx-ru@xxxxxxxxx
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:received:date:message-id :subject:from:to:cc:content-type; bh=X3GikH3aPDOYW7YGCUGDZNTOjxnimVA4DWUFziHasuU=; b=NQ5Pxn9A2jAn6s22R84gF+l3HTukpjt20GA5micStg4Ssfxi3srQ8s81ig/QceIqpJ aRfw4pu6rvMl13Wbuw2JQfxDUg7hdT9h6NkWa1nrkw3CnL3r45VriBNXIgYM6WO2Nhbg 3mBA8p2p2hFcXjh1PscCNz2ReaxJBLQmFI0fY=
- Domainkey-signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:date:message-id:subject:from:to:cc:content-type; b=oL7gfObdCWQBiAdB5MQ3F7rhQWQVTeHloGJ2hwn0UwI2e7vEW2BqBvhHR7RjYNMqqD 06tQYZvPuCH5hhQI68Lal+XvT1WpBkricK5oCW2h7GNexTlPE2Hrl9sKsRys0uUwejYD cOEzHW2W9du+RFH50blXGj8vJh2tkMHT1NgqM=
Здравствуйте.
Обнаружил проблему, иногда появляющуюся при получении пути к файлу с
шаблоном из заголовка X-Template (ngx_str_t->data без терминирующего
нуля используется в дальнейшем как этот ноль имеющая).
По быстрому сделал патч.
Спасибо.
--
Igor A. Valcov
diff -Naur mod-ctpp2/sources/ngx_http_ctpp2_filter_module.c
mod-ctpp2-patched/sources/ngx_http_ctpp2_filter_module.c
--- mod-ctpp2/sources/ngx_http_ctpp2_filter_module.c 2010-11-18
11:45:03.425547359 +0300
+++ mod-ctpp2-patched/sources/ngx_http_ctpp2_filter_module.c 2010-11-18
10:58:53.055292994 +0300
@@ -192,6 +192,17 @@
return NGX_ERROR;
}
}
+
+ ngx_str_t *tmpl_orig = tmpl;
+ tmpl = ngx_pcalloc(r->pool, sizeof(ngx_str_t));
+ if (tmpl == NULL)
+ return ngx_http_next_header_filter(r);
+ tmpl->data = ngx_pcalloc(r->pool, tmpl_orig->len + 1);
+ if (tmpl->data == NULL)
+ return ngx_http_next_header_filter(r);
+ ngx_memcpy(tmpl->data, tmpl_orig->data, tmpl_orig->len);
+ tmpl->len = tmpl_orig->len;
+
ngx_log_debug1(NGX_LOG_DEBUG_HTTP, r->connection->log, 0,
"http ctpp2: Template \"%s\" will be processed", tmpl->data);
_______________________________________________
nginx-ru mailing list
nginx-ru@xxxxxxxxx
http://nginx.org/mailman/listinfo/nginx-ru
|