diff options
author | Giovanni Bechis <gbechis@apache.org> | 2023-04-05 08:38:18 +0200 |
---|---|---|
committer | Giovanni Bechis <gbechis@apache.org> | 2023-04-05 08:38:18 +0200 |
commit | 24007faa4f5cb59e494feb764e3a247018dc3907 (patch) | |
tree | 249a9996ce944cc977f0fd086c9b1bbd33157b01 /server/apreq_parser_header.c | |
parent | Fix a possible NULL pointer dereference of ap_runtime_dir_relative() (diff) | |
download | apache2-24007faa4f5cb59e494feb764e3a247018dc3907.tar.xz apache2-24007faa4f5cb59e494feb764e3a247018dc3907.zip |
Fix possible NULL pointer dereference casued by apreq_param_make()
The function apreq_param_make() will return NULL on failure. However
NULL check are forgetten before derenference, which could lead to
NULL pointer dereference.
Adding NULL check to all use of apreq_param_make().
Submitted by: Zhou Qingyang <zhou1615@umn.edu>
Github: closes #303
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1908981 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'server/apreq_parser_header.c')
-rw-r--r-- | server/apreq_parser_header.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/server/apreq_parser_header.c b/server/apreq_parser_header.c index 6f72f563fd..e3c789eb12 100644 --- a/server/apreq_parser_header.c +++ b/server/apreq_parser_header.c @@ -84,6 +84,8 @@ static apr_status_t consume_header_line(apreq_param_t **p, int i, eol = 0; param = apreq_param_make(pool, NULL, nlen, NULL, vlen); + if (param == NULL) + return APR_ENOMEM; *(const apreq_value_t **)&v = ¶m->v; arr.pool = pool; |