summaryrefslogtreecommitdiffstats
path: root/server/apreq_module_cgi.c
diff options
context:
space:
mode:
authorGiovanni Bechis <gbechis@apache.org>2023-03-23 17:23:12 +0100
committerGiovanni Bechis <gbechis@apache.org>2023-03-23 17:23:12 +0100
commit2133fa3a38bf385ab5fbe0f8faf11d31f833a84f (patch)
tree5a7c01a56d17d2addbf101f710fd1ac1bff5dfe2 /server/apreq_module_cgi.c
parent* modules/lua: Use https: URLs for httpd.a.o in docs. [skip ci] (diff)
downloadapache2-2133fa3a38bf385ab5fbe0f8faf11d31f833a84f.tar.xz
apache2-2133fa3a38bf385ab5fbe0f8faf11d31f833a84f.zip
check apreq_cookie_make return value
Github: closes #302 git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1908673 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'server/apreq_module_cgi.c')
-rw-r--r--server/apreq_module_cgi.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/server/apreq_module_cgi.c b/server/apreq_module_cgi.c
index 779115dd6e..eaf4e99ef4 100644
--- a/server/apreq_module_cgi.c
+++ b/server/apreq_module_cgi.c
@@ -516,6 +516,8 @@ static apr_status_t cgi_jar(apreq_handle_t *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_handle_t *handle,
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;