Mercurial > blahgd
changeset 943:ff12795dbe84
req: don't leak request formats when processing 404 and 301 responses
In both cases we override the fmt a few lines later.
Signed-off-by: Josef 'Jeff' Sipek <jeffpc@josefsipek.net>
author | Josef 'Jeff' Sipek <jeffpc@josefsipek.net> |
---|---|
date | Mon, 12 Mar 2018 15:29:09 +0200 |
parents | bb2882be9b2b |
children | 5b0116b502d1 |
files | req.c |
diffstat | 1 files changed, 4 insertions(+), 0 deletions(-) [+] |
line wrap: on
line diff
--- a/req.c Mon Mar 12 15:28:22 2018 +0200 +++ b/req.c Mon Mar 12 15:29:09 2018 +0200 @@ -412,6 +412,8 @@ int R404(struct req *req, char *tmpl) { + str_putref(req->fmt); + tmpl = tmpl ? tmpl : "{404}"; req_head(req, "Content-Type", "text/html"); @@ -430,6 +432,8 @@ int R301(struct req *req, const char *url) { + str_putref(req->fmt); + DBG("status 301 (url: '%s')", url); req_head(req, "Content-Type", "text/html");