]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
BUG/MINOR: sample: request an extra output byte for the url_dec converter
authorWilly Tarreau <w@1wt.eu>
Tue, 26 May 2026 06:24:04 +0000 (08:24 +0200)
committerWilly Tarreau <w@1wt.eu>
Tue, 26 May 2026 11:13:24 +0000 (13:13 +0200)
A dynamic chunk size is now being allocated for output since commit
dfc4085413 ("MEDIUM: sample: Get chunks with a size dependent on input
data when necessary"). However this one missed the need for the trailing
zero when specifying the size, let's add it.

No backport is needed, this is only in 3.4.

src/http_conv.c

index a46432dc03340aa9ba97d0f01fa1d1494485fcf3..c0a2f95360ab9f5c45dadf66172f729cd89432ce 100644 (file)
@@ -263,7 +263,7 @@ static int sample_conv_url_dec(const struct arg *args, struct sample *smp, void
          * before decoding.
         */
        if (smp->flags & SMP_F_CONST || smp->data.u.str.size <= smp->data.u.str.data) {
-               struct buffer *str = get_trash_chunk_sz(smp->data.u.str.data);
+               struct buffer *str = get_trash_chunk_sz(smp->data.u.str.data + 1);
 
                if (!str)
                        return 0;