From 1a09953b2439f94714feb03358b793ccbae8a2ca Mon Sep 17 00:00:00 2001
From: covener <covener@apache.org>
Date: Wed Jun 1 12:31:19 2022 UTC
Subject: [PATCH] lua_request:fix lua request with cast first

Conflict:NA
Reference:https://github.com/apache/httpd/commit/1a09953b2439f94714feb03358b793ccbae8a2ca

---
 modules/lua/lua_request.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/modules/lua/lua_request.c b/modules/lua/lua_request.c
index a7e501b..1ba6a2f 100644
--- a/modules/lua/lua_request.c
+++ b/modules/lua/lua_request.c
@@ -251,7 +251,7 @@ static int lua_read_body(request_rec *r, const char **rbuf, apr_off_t *size,
         if (maxsize != 0 && length > maxsize) {
             return APR_EINCOMPLETE; /* Only room for incomplete data chunk :( */
         }
-        *rbuf = (const char *) apr_pcalloc(r->pool, (apr_size_t) (length + 1));
+        *rbuf = (const char *) apr_pcalloc(r->pool, (apr_size_t) (length) + 1);
         while ((rpos < length)
                && (len_read = ap_get_client_block(r, (char *) *rbuf + rpos,
                                                length - rpos)) > 0) {
-- 
2.23.0

