From 574d0d8211ceb6a3ae3f150c2d2900c52c167ddc Mon Sep 17 00:00:00 2001 From: Christopher Faulet Date: Tue, 22 Jul 2025 18:23:57 +0200 Subject: [PATCH] BUG/MINOR: applet: Fix applet_getword() to not return one extra byte applet_getword() function is returning one extra byte when a string is returned because the "ret" variable is not reset before the loop on the data. The patch also fixes applet_getline(). It is a 3.3-specific issue. No need to backport. --- include/haproxy/applet.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/haproxy/applet.h b/include/haproxy/applet.h index 261adfa1d..6eec621b4 100644 --- a/include/haproxy/applet.h +++ b/include/haproxy/applet.h @@ -645,7 +645,7 @@ static inline int applet_getword(const struct appctx *appctx, char *str, int len } p = b_head(buf); - + ret = 0; while (max) { *str++ = *p; ret++; -- 2.47.2