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:31 UTC

(tomcat-connectors) 18/20: Add overrun protection

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 21987720da59ea06b703c5d304c5b34824371423
Author: Christopher Schultz <ch...@christopherschultz.net>
AuthorDate: Mon Jun 8 16:59:02 2026 -0400

    Add overrun protection
    
    Reduce unnecessary safety margin
---
 native/common/jk_ajp12_worker.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/native/common/jk_ajp12_worker.c b/native/common/jk_ajp12_worker.c
index d9d860ba5..40f45fbe3 100644
--- a/native/common/jk_ajp12_worker.c
+++ b/native/common/jk_ajp12_worker.c
@@ -390,8 +390,8 @@ static int ajpv12_mark(ajp12_endpoint_t * p, unsigned char type)
 
 static int ajpv12_sendint(ajp12_endpoint_t * p, int d)
 {
-    char buf[20];
-    sprintf(buf, "%d", d);
+    char buf[16];
+    snprintf(buf, sizeof(buf), "%d", d);
     return ajpv12_sendstring(p, buf);
 }
 


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