BUG/MINOR: sample: Set the correct type when a binary is converted to a string
authorChristopher Faulet <cfaulet@haproxy.com>
Thu, 30 Apr 2020 07:57:40 +0000 (09:57 +0200)
committerChristopher Faulet <cfaulet@haproxy.com>
Wed, 20 May 2020 16:44:44 +0000 (18:44 +0200)
A binary sample data can be converted, implicitly or not, to a string by cutting
the buffer on the first null byte.

I guess this patch should be backported to all stable versions.

(cherry picked from commit 472ad51edeb4bb5ea601d7e296b5d0a0cd1a140a)
Signed-off-by: Christopher Faulet <cfaulet@haproxy.com>

src/sample.c

index 7362a2d..6cda2e1 100644 (file)
@@ -621,6 +621,7 @@ static int c_bin2str(struct sample *smp)
                        break;
                }
        }
+       smp->data.type = SMP_T_STR;
        return 1;
 }