Mailing List Archive

svn commit: r1908673 - /httpd/httpd/trunk/server/apreq_module_cgi.c
Author: gbechis
Date: Thu Mar 23 16:23:12 2023
New Revision: 1908673

URL: http://svn.apache.org/viewvc?rev=1908673&view=rev
Log:
check apreq_cookie_make return value
Github: closes #302

Modified:
httpd/httpd/trunk/server/apreq_module_cgi.c

Modified: httpd/httpd/trunk/server/apreq_module_cgi.c
URL: http://svn.apache.org/viewvc/httpd/httpd/trunk/server/apreq_module_cgi.c?rev=1908673&r1=1908672&r2=1908673&view=diff
==============================================================================
--- httpd/httpd/trunk/server/apreq_module_cgi.c (original)
+++ httpd/httpd/trunk/server/apreq_module_cgi.c Thu Mar 23 16:23:12 2023
@@ -516,6 +516,8 @@ static apr_status_t cgi_jar(apreq_handle
if (val == NULL)
val = "";
p = apreq_cookie_make(handle->pool, name, strlen(name), val, strlen(val));
+ if (p == NULL)
+ return APR_ENOMEM;
apreq_cookie_tainted_on(p);
apreq_value_table_add(&p->v, req->jar);
}
@@ -606,6 +608,8 @@ static apreq_cookie_t *cgi_jar_get(apreq
if (val == NULL)
return NULL;
p = apreq_cookie_make(handle->pool, name, strlen(name), val, strlen(val));
+ if (p == NULL)
+ return NULL;
apreq_cookie_tainted_on(p);
apreq_value_table_add(&p->v, req->jar);
val = p->v.data;