From: Christopher Faulet Date: Tue, 22 Jul 2025 16:23:57 +0000 (+0200) Subject: BUG/MINOR: applet: Fix applet_getword() to not return one extra byte X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=bbf668a18a20fa52a28a9958357c159d99747cfe;p=thirdparty%2Fhaproxy.git 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. --- 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++;