File apache2-CVE-2022-29404.patch of Package apache2.27541
From 0c2910f07458179254e0127aa64f2d057c15d110 Mon Sep 17 00:00:00 2001
From: Eric Covener <covener@apache.org>
Date: Wed, 1 Jun 2022 12:29:46 +0000
Subject: [PATCH] cast first
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1901496 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 52639291ae1..0dadd4e83c3 100644
--- a/modules/lua/lua_request.c
+++ b/modules/lua/lua_request.c
@@ -252,7 +252,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) {