[Privoxy-commits] [privoxy] 11/19: error_response(): Don't generate an out-of-memory response
User Git
git at git.privoxy.org
Thu Jun 11 08:29:15 CEST 2026
This is an automated email from the git hooks/post-receive script.
git pushed a commit to branch master
in repository privoxy.
commit 5629d9628331e8bfbccb1d8596b4e189ca700e4a
Author: Fabian Keil <fk at fabiankeil.de>
AuthorDate: Mon Jun 8 07:36:23 2026 +0200
error_response(): Don't generate an out-of-memory response
... if a request can't be webserver-forwarded.
---
cgi.c | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/cgi.c b/cgi.c
index fb663b85..54acc3cc 100644
--- a/cgi.c
+++ b/cgi.c
@@ -945,6 +945,9 @@ struct http_response *error_response(struct client_state *csp,
{
const struct forward_spec *fwd = forward_url(csp, csp->http);
char *socks_type = NULL;
+ const char *gateway_string = (fwd->gateway_host != NULL) ?
+ fwd->gateway_host : "a direct connection";
+
if (fwd == NULL)
{
log_error(LOG_LEVEL_FATAL, "gateway spec is NULL. This shouldn't happen!");
@@ -970,7 +973,7 @@ struct http_response *error_response(struct client_state *csp,
log_error(LOG_LEVEL_ERROR, "Socks failure reason missing.");
csp->error_message = strdup("Failure reason missing. Check the log file for details.");
}
- if (!err) err = map(exports, "gateway", 1, fwd->gateway_host, 1);
+ if (!err) err = map(exports, "gateway", 1, gateway_string, 1);
/*
* XXX: this is almost the same code as in cgi_show_url_info()
--
To stop receiving notification emails like this one, please contact
the administrator of this repository.
More information about the Privoxy-commits
mailing list