From 452c573ab776a7b1947a2647648690c0cef48fde Mon Sep 17 00:00:00 2001 From: Fabian Keil Date: Tue, 9 Jan 2007 11:54:26 +0000 Subject: [PATCH] Fix strdup() error handling in cgi_error_unknown() and cgi_error_no_template(). Reported by Markus Elfring. --- cgi.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/cgi.c b/cgi.c index 2188560e..b9863c7b 100644 --- a/cgi.c +++ b/cgi.c @@ -1,4 +1,4 @@ -const char cgi_rcs[] = "$Id: cgi.c,v 1.84 2006/12/28 17:54:22 fabiankeil Exp $"; +const char cgi_rcs[] = "$Id: cgi.c,v 1.85 2007/01/05 14:19:02 fabiankeil Exp $"; /********************************************************************* * * File : $Source: /cvsroot/ijbswa/current/cgi.c,v $ @@ -38,6 +38,9 @@ const char cgi_rcs[] = "$Id: cgi.c,v 1.84 2006/12/28 17:54:22 fabiankeil Exp $"; * * Revisions : * $Log: cgi.c,v $ + * Revision 1.85 2007/01/05 14:19:02 fabiankeil + * Handle pcrs_execute() errors in template_fill() properly. + * * Revision 1.84 2006/12/28 17:54:22 fabiankeil * Fixed gcc43 conversion warnings and replaced sprintf * calls with snprintf to give OpenBSD's gcc one less reason @@ -1501,7 +1504,7 @@ jb_err cgi_error_no_template(struct client_state *csp, strcat(rsp->body, body_suffix); rsp->status = strdup(status); - if (rsp->body == NULL) + if (rsp->status == NULL) { return JB_ERR_MEMORY; } @@ -1578,7 +1581,7 @@ jb_err cgi_error_unknown(struct client_state *csp, strcat(rsp->body, body_suffix); rsp->status = strdup(status); - if (rsp->body == NULL) + if (rsp->status == NULL) { return JB_ERR_MEMORY; } -- 2.39.2