You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tomcat.apache.org by sc...@apache.org on 2026/06/09 13:44:16 UTC

(tomcat-connectors) 03/20: Avoid overflow on alignment adjustment

This is an automated email from the ASF dual-hosted git repository.

ChristopherSchultz pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/tomcat-connectors.git

commit 197c7baf308002b327abbc8f885ede8aa94351cb
Author: Christopher Schultz <ch...@christopherschultz.net>
AuthorDate: Mon Jun 8 11:43:09 2026 -0400

    Avoid overflow on alignment adjustment
---
 native/common/jk_pool.c | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/native/common/jk_pool.c b/native/common/jk_pool.c
index 5c8de05e9..9adbfa761 100644
--- a/native/common/jk_pool.c
+++ b/native/common/jk_pool.c
@@ -64,6 +64,11 @@ void *jk_pool_alloc(jk_pool_t *p, size_t size)
 
     if (size == 0)
         return NULL;
+
+    if (sz > SIZE_MAX - JK_ALIGN_DEFAULT(1)) {
+        return NULL;
+    }
+
     size = JK_ALIGN_DEFAULT(size);
     if ((p->size - p->pos) >= size) {
         rc = &(p->buf[p->pos]);


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org