From 1a09953b2439f94714feb03358b793ccbae8a2ca Mon Sep 17 00:00:00 2001
From: Eric Covener <covener@apache.org>
Date: Wed, 1 Jun 2022 12:31:19 +0000
Subject: [PATCH] Merge r1901496 from trunk:

cast first


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/branches/2.4.x@1901498 13f79535-47bb-0310-9956-ffa450edef68
---
 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 1eab7b6a47b..a3e3b613bc9 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) {
